/** creates a zonelist component used to save all zones (persist) */ private static void createZoneList() { zonelist = CoreRegistry.get(EntityManager.class).create(); ZoneListComponent zonecomp = new ZoneListComponent(); zonelist.addComponent(zonecomp); zonelist.setPersisted(true); zonelist.saveComponent(zonecomp); }
/** * adds a new zone to the corresponding zone list * * @param zone the zone to be added */ public static void addZone(Zone zone) { ZoneListComponent zonelistcomp = zonelist.getComponent(ZoneListComponent.class); switch (zone.zonetype) { case Gather: { zonelistcomp.Gatherzones.add(zone); break; } case Work: { zonelistcomp.Workzones.add(zone); break; } case Terraform: { zonelistcomp.Terrazones.add(zone); break; } case Storage: { zonelistcomp.Storagezones.add(zone); break; } case OreonFarm: { zonelistcomp.OreonFarmzones.add(zone); break; } } zonelist.saveComponent(zonelistcomp); }