Beispiel #1
0
 public Building(BuildingType t, Sector s, DateTime d)
 {
     this.type = t;
     this.sector = s;
     this.date = d;
     this.hitpoints = Info.Hitpoints;
     this.number = 1;
     this.UpgradingFrom = BuildingType.None;
     Sector.Buildings.Add(this);
     if (Sector.Owner != null)
         Sector.Owner.Buildings.Add(this);
 }
Beispiel #2
0
 public override void Create(Sector s)
 {
     if (!s.Units.Contains(this))
         s.Units.Add(this);
     if (Owner != null)
         Owner.Units.Add(this);
 }
Beispiel #3
0
 public Unit(UnitType t, Sector s, Player p, DateTime d)
 {
     this.type = t;
     this.sector = s;
     this.owner = p;
     this.date = d;
     this.action = UnitAction.None;
     this.hitpoints = Info.Hitpoints;
     this.number = 1;
     Sector.Units.Add(this);
     if (Owner != null)
         Owner.Units.Add(this);
 }
Beispiel #4
0
 public override void Create(Sector s)
 {
     if (!s.Buildings.Contains(this))
         s.Buildings.Add(this);
     if (s.Owner != null)
         s.Owner.Buildings.Add(this);
 }
Beispiel #5
0
        public bool HasView(Sector s)
        {
            if (IsAlly(s.Owner))
                return true;

            foreach (Unit u in s.Units)
                if ((u.IsAvailable || u.IsWorking) && IsAlly(u.Owner))
                    return true;

            return false;
        }
Beispiel #6
0
 public abstract void Create(Sector s);