public UnitComponent(Entities.UnitStats stats)
        {
            actionQueue = new ActionQueue();
            AddChild(actionQueue);
            UnitAddedToCellHandlers = handleUnitAddedToCell;

            this.maxHealth = stats.maxHealth;
            this.currentHealth = stats.maxHealth;
            this.speed = stats.speed;
            this.buildSpeed = stats.buildSpeed;
            this.canAttack = stats.canAttack;
            this.canBuild = stats.canBuild;
            this.canHarvest = stats.canHarvest;
            this.isZombie = stats.isZombie;
            this.type = stats.type;
            this.visibilityRange = stats.visibilityRange;
            this.attack = stats.attack;
            this.attackRange = stats.attackRange;
            this.attackTicks = stats.attackTicks;
        }
        public UnitComponent(Entities.UnitStats stats)
        {
            actionQueue = new ActionQueue();
            AddChild(actionQueue);
            UnitAddedToCellHandlers = handleUnitAddedToCell;

            this.maxHealth       = stats.maxHealth;
            this.currentHealth   = stats.maxHealth;
            this.speed           = stats.speed;
            this.buildSpeed      = stats.buildSpeed;
            this.canAttack       = stats.canAttack;
            this.canBuild        = stats.canBuild;
            this.canHarvest      = stats.canHarvest;
            this.isZombie        = stats.isZombie;
            this.type            = stats.type;
            this.visibilityRange = stats.visibilityRange;
            this.attack          = stats.attack;
            this.attackRange     = stats.attackRange;
            this.attackTicks     = stats.attackTicks;
        }
Ejemplo n.º 3
0
 public void Visit(ActionQueue queue)
 {
     // We do not output the action queue, or any of its children.
 }
        private float visibilityRange = 6.0f; // How far can the unit see.

        #endregion Fields

        #region Constructors

        public UnitComponent()
        {
            actionQueue = new ActionQueue();
            AddChild(actionQueue);
            UnitAddedToCellHandlers = handleUnitAddedToCell;
        }
 public UnitComponent()
 {
     actionQueue = new ActionQueue();
     AddChild(actionQueue);
     UnitAddedToCellHandlers = handleUnitAddedToCell;
 }
 public virtual void Visit(ActionQueue queue)
 {
     Visit((ModelComponent)queue);
 }
 public virtual void Visit(ActionQueue queue)
 {
     Visit((ModelComponent)queue);
 }
 public void Visit(ActionQueue queue)
 {
     // We do not output the action queue, or any of its children.
 }
 public void Visit(ActionQueue queue)
 {
     if (ActionQueueVisitor != null)
         queue.Accept(ActionQueueVisitor);
 }