Ejemplo n.º 1
0
 public int resourceValue(CLoc loc)
 {
     if (resources_.ContainsKey(loc.getKey()))
     {
         return(resources_[loc.getKey()]);
     }
     return(0);
 }
Ejemplo n.º 2
0
 public void setMine(CLoc loc, bool add)
 {
     if (!add && mines_.ContainsKey(loc.getKey()))
     {
         mines_.Remove(loc.getKey());
     }
     if (add && !mines_.ContainsKey(loc.getKey()))
     {
         mines_.Add(loc.getKey(), true);
     }
 }
Ejemplo n.º 3
0
 public void addRoad(CLoc loc, bool add)
 {
     if (!add && roads_.ContainsKey(loc.getKey()))
     {
         roads_.Remove(loc.getKey());
     }
     else if (add && !roads_.ContainsKey(loc.getKey()))
     {
         roads_.Add(loc.getKey(), true);
     }
 }
Ejemplo n.º 4
0
 public void setWasteland(CLoc loc, bool add)
 {
     if (!add && wasteland_.ContainsKey(loc.getKey()))
     {
         wasteland_.Remove(loc.getKey());
     }
     if (add && !wasteland_.ContainsKey(loc.getKey()))
     {
         wasteland_.Add(loc.getKey(), true);
     }
 }
Ejemplo n.º 5
0
        public void encode(CEncodedObjectOutputBufferI output)
        {
            output.openObject(TAG);
            output.addAttr(VALUE, Convert.ToString(value_));
            output.addAttr(PKEY, Convert.ToString(pkey_));
            output.addAttr(CKEY, Convert.ToString(ckey_));

            output.addTextObject(RTYPE, rtype_);
            if (report_ != null)
            {
                output.addTextObject(REPORT, report_);
            }
            if (ptype_ != null)
            {
                output.addTextObject(PTYPE, ptype_);
            }
            if (ctype_ != null)
            {
                output.addTextObject(CTYPE, ctype_);
            }
            if (loc_ != null)
            {
                output.addTextObject(LOC, loc_.getKey());
            }

            output.objectEnd();
        }
Ejemplo n.º 6
0
 public void setResource(CLoc loc, int rv)
 {
     if (rv == 0 && resources_.ContainsKey(loc.getKey()))
     {
         resources_.Remove(loc.getKey());
     }
     else if (rv > 0)
     {
         if (resources_.ContainsKey(loc.getKey()))
         {
             resources_[loc.getKey()] = rv;
         }
         else
         {
             resources_.Add(loc.getKey(), rv);
         }
     }
 }
Ejemplo n.º 7
0
 public void encode(CEncodedObjectOutputBufferI output)
 {
     output.openObject(TAG);
     output.addAttr(RID, Convert.ToString(rid_));
     output.addAttr(SOURCE, Convert.ToString(source_));
     output.addAttr(SOURCE_LOC, sourceLoc_.getKey());
     output.addAttr(DEST, Convert.ToString(dest_));
     output.addAttr(DEST_LOC, Convert.ToString(destLoc_.getKey()));
     output.addAttr(IN_TRANSIT, Convert.ToString(inTransit_));
     output.addAttr(NEXT_ARRIVAL, Convert.ToString(nextArrival_));
     output.objectEnd();
 }
Ejemplo n.º 8
0
 protected virtual void encodeAttributes(CEncodedObjectOutputBufferI output)
 {
     output.addAttr(UTYPE, utype_);
     output.addAttr(LOC, loc_.getKey());
     output.addAttr(GID, Convert.ToString(gid_));
     output.addAttr(OWNER, Convert.ToString(owner_));
     output.addAttr(STACKLAYER, Convert.ToString(stackLayer_));
     output.addAttr(LEVEL, level_);
     output.addAttr(LANDED, EncodeUtil.makeBoolString(landed_));
     output.addAttr(INREENTRY, EncodeUtil.makeBoolString(inReentry_));
     output.addAttr(HOST, Convert.ToString(host_));
     output.addAttr(TURN, Convert.ToString(turn_));
     output.addAttr(RMVR, Convert.ToString(rmvr_));
     output.addAttr(RMVS, Convert.ToString(rmvs_));
     output.addAttr(FIRED, EncodeUtil.makeBoolString(fired_));
     output.addAttr(ARMED, EncodeUtil.makeBoolString(armed_));
     output.addAttr(DMG, Convert.ToString(dmg_));
     output.addAttr(SHORTFUEL, EncodeUtil.makeBoolString(shortFuel_));
     output.addAttr(SAWENEMY, EncodeUtil.makeBoolString(sawEnemy_));
     output.addAttr(DUGIN, EncodeUtil.makeBoolString(dugIn_));
     output.addAttr(EXPERIENCE, Convert.ToString(experience_));
     output.addAttr(READINESS, readiness_);
     output.addAttr(EXPTYPE, expType_);
 }
Ejemplo n.º 9
0
 public bool isMine(CLoc loc)
 {
     return(mines_.ContainsKey(loc.getKey()));
 }
Ejemplo n.º 10
0
 public bool isWasteland(CLoc loc)
 {
     return(wasteland_.ContainsKey(loc.getKey()));
 }
Ejemplo n.º 11
0
 public bool hasRoad(CLoc loc)
 {
     return(roads_.ContainsKey(loc.getKey()));
 }