예제 #1
0
 private void updatePosition()
 {
     // Update our position
     if (!this.tileCentric && platoon.units.Count > 0)
     {
         this.position = (GameTile)platoon.world.getTileAt(platoon.getCenter());
         posVec        = new Engine.Vector2(this.position.x, this.position.y);
         cluster.setCenter(position);
     }
 }
예제 #2
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);
        }