/*
  * Surround whatever we can find within a square w/ radius radius centered on center.
  */
 public SurroundOrder2(Platoon platoon, GameTile center, int radius)
     : base(platoon)
 {
     this.target = null;
     radius     *= GameTile.size;
     zone        = new RectangleF(center.x - radius, center.y - radius, 2 * radius, 2 * radius);
 }
        public ComputerPlayer(GameWorld world, team_t team)
            : base(world, team)
        {
            // For right now, we'll group all our units into one platoon
            // Typically, you would create new, smaller, mutually exclusive lists,
            // and feed one to each platoon
            Platoon dfltPlat = new Platoon(this.world, this.team);
            //Order dfltOrder = new HoldPositionOrder(dfltPlat, null, 5);
            //Order dfltOrder = new SurroundOrder(dfltPlat);
            Order dfltOrder = new SurroundOrder2(dfltPlat);

            //Order dfltOrder = new AttackOrder(dfltPlat, null);
            dfltPlat.setOrder(dfltOrder);
            platoons = new LinkedList <Platoon>();
            platoons.AddLast(dfltPlat);
            turnThread = null;

            saveUnitList();
        }
Exemple #3
0
        public HoldPositionOrder(Platoon platoon, GameTile position, int attackRadius)
            : base(platoon)
        {
            if (position == null && (platoon.units == null || platoon.units.Count == 0))
            {
                this.position = (GameTile)platoon.world.getTileAt(100, 100);
            }
            else if (position == null)
            {
                // We'll hold the position that the units currently occupy
                this.position    = (GameTile)platoon.world.getTileAt(platoon.getCenter());
                this.tileCentric = false;
            }
            else
            {
                this.position    = position;
                this.tileCentric = true;
            }
            posVec            = new Engine.Vector2(this.position.x, this.position.y);
            this.attackRadius = attackRadius;

            this.cluster = new ClusterOrder(this.platoon, this.position);
        }
 public ClusterOrder(Platoon platoon, GameTile target)
     : base(platoon)
 {
     setCenter(target);
 }
 public SurroundOrder(Platoon platoon) : base(platoon)
 {
 }
 public Order(Platoon platoon)
 {
     this.platoon = platoon;
 }
Exemple #7
0
 public AttackOrder(Platoon platoon, AnimalActor enemy) : base(platoon)
 {
     this.enemy = enemy;
 }
 /*
  * Surround, either whatever we can find or a particular unit
  */
 public SurroundOrder2(Platoon platoon, AnimalActor target = null)
     : base(platoon)
 {
     this.target = target;
     this.zone   = null;
 }
 public RetreatOrder(Platoon platoon, GameTile target)
     : base(platoon)
 {
 }