예제 #1
0
파일: Base.java 프로젝트: Kagesh/Presidium
  public Base(Session s) throws Exception {
    s.cacheInstance(this);
    this.world = s.world();
    commerce.loadState(s);
    credits = s.loadFloat();

    ruler = (Actor) s.loadObject();
    s.loadObjects(missions);

    communitySpirit = s.loadFloat();
    alertLevel = s.loadFloat();
    crimeLevel = s.loadFloat();
    averageMood = s.loadFloat();
    for (int n = s.loadInt(); n-- > 0; ) {
      final Relation r = Relation.loadFrom(s);
      baseRelations.put(r.subject, r);
    }

    paving = new Paving(world);
    paving.loadState(s);

    dangerMap = new DangerMap(world, this);
    dangerMap.loadState(s);
    intelMap.loadState(s);
  }
예제 #2
0
파일: Base.java 프로젝트: Kagesh/Presidium
  public void saveState(Session s) throws Exception {
    commerce.saveState(s);
    s.saveFloat(credits);

    s.saveObject(ruler);
    s.saveObjects(missions);

    s.saveFloat(communitySpirit);
    s.saveFloat(alertLevel);
    s.saveFloat(crimeLevel);
    s.saveFloat(averageMood);
    s.saveInt(baseRelations.size());
    for (Relation r : baseRelations.values()) Relation.saveTo(s, r);

    paving.saveState(s);

    dangerMap.saveState(s);
    intelMap.saveState(s);
  }
예제 #3
0
파일: Base.java 프로젝트: Kagesh/Presidium
 public float relationWith(Base base) {
   final Relation r = baseRelations.get(base);
   if (r == null) return 0;
   return r.value();
 }