Пример #1
0
 public void UnitSelectedEventHandler(object sender, SelectedEventArgs args)
 {
     if (args.Objects == null || args.Objects.Count <= 0)
     {
         _selected = null;
         return;
     }
     if (args.Objects.Count == 1 && args.Objects[0] is Unit)
     {
         _selected = (Unit)args.Objects[0];
     }
     else
         _selected = null;
 }
Пример #2
0
 private void init(WeaponType wep, ArmorType a, EngineType e, Sprite s)
 {
     weapon = wep;
     armor = a;
     engine = e;
     image = s;
     protoType = new Unit(this);
 }
Пример #3
0
 public UnitBuiltEventArgs(Unit u)
 {
     unit = u;
 }
Пример #4
0
 protected virtual void removeObjectFromWorld(Unit toRemove)
 {
     units.Remove(toRemove);
 }
Пример #5
0
 protected virtual void makeUnitIdle(Unit u)
 {
     u.forceFinishAction();
     u.idle();
 }
Пример #6
0
 /// <summary>
 /// Copy ctor
 /// </summary>
 /// <param name="u">
 /// A <see cref="Unit"/>
 /// </param>
 public Unit(Unit u)
     : base()
 {
     this.Type = u.Type;
     init();
 }
Пример #7
0
 protected override void removeObjectFromWorld(Unit toRemove)
 {
     units.Remove(toRemove);
 }
Пример #8
0
 protected override void makeUnitIdle(Unit u)
 {
     u.forceFinishAction();
     u.idle();
 }