Exemplo n.º 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);
 }
Exemplo n.º 2
0
 public override void Create(Sector s)
 {
     if (!s.Units.Contains(this))
         s.Units.Add(this);
     if (Owner != null)
         Owner.Units.Add(this);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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;
        }
Exemplo n.º 6
0
 public abstract void Create(Sector s);