Initial commit

This commit is contained in:
Zukero
2015-02-23 22:43:19 +01:00
commit 59d8ad1cdb
212 changed files with 29432 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
package com.gpl.rpg.atcontentstudio.model.maps;
import java.awt.Image;
import com.gpl.rpg.atcontentstudio.model.GameDataElement;
import com.gpl.rpg.atcontentstudio.model.gamedata.Droplist;
import com.gpl.rpg.atcontentstudio.ui.DefaultIcons;
public class ContainerArea extends MapObject {
public Droplist droplist = null;
public ContainerArea(tiled.core.MapObject obj) {}
@Override
public void link() {
droplist = parentMap.getProject().getDroplist(name);
if (droplist != null) {
droplist.addBacklink(parentMap);
}
}
@Override
public Image getIcon() {
if (droplist != null) return DefaultIcons.getContainerIcon();
else return DefaultIcons.getNullifyIcon();
}
@Override
public void elementChanged(GameDataElement oldOne, GameDataElement newOne) {
if (oldOne == droplist) {
droplist = (Droplist) newOne;
newOne.addBacklink(parentMap);
}
}
@Override
public void savePropertiesInTmxObject(tiled.core.MapObject tmxObject) {
if (droplist != null) {
tmxObject.setName(droplist.id);
}
}
}