private static bool isDead(Entity entity, long curTick)
        {
            if (entity.health <= 0 && !entity.getState().inState(State.PrimaryState.Dead))
            {
                entity.getState().setPrimaryState(State.PrimaryState.Dead);
                entity.tickKilled = curTick;
                return true;
            }

            return false;
        }
        /// <summary>
        /// The basic outline of the updateEntity method is as follows:
        /// 1, Have the entity perform the current action at the top of it's action queue (if any)
        /// 2, Check for changes in the entity's stats. (ex: check for death.)
        /// 3, Have the Entity react to any Events that occur within it's visibility range.
        /// (Events that either occur to the Entity or events that the Entity can "see")
        /// 4, Check if the Entity should be removed from the game. (When it's primary state is set to Remove.)
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="entitiesToRemove"></param>
        private void updateEntity(Entity entity, List<Entity> entitiesToRemove)
        {
            /*** Have entity perform it's current action (if any) ***/
            ActionController.Instance.update(entity, locController);

            Entity.EntityType type = entity.getEntityType();
            /*** Update stats of Entity ***/
            if (type == Entity.EntityType.Unit)
            {
                UnitStatsLogic.updateUnit((Unit)entity, curTick);
            }
            else
            {
                // Only Stats update occurs upon death of any StaticEntity right?
                if (entity.health <= 0)
                {
                    entity.getState().setPrimaryState(State.PrimaryState.Dead);
                }
            }

            /*** Have Entity react to any Events ***/
            if (type == Entity.EntityType.Unit) // Only Units really need to react to Events.
            {

            }

            /*** Remove Entity if it needs to be removed. ***/
            if (entity.getState().getPrimaryState() == State.PrimaryState.Dead) // Should be remove. Changed for demo.
            {
                entitiesToRemove.Add(entity);
            }
        }
        /// <summary>
        /// Given an entity, this function will cause the entity to perform whatever action is currently on the entity's
        /// action queue.
        /// </summary>
        /// <param name="entity"></param>
        public void update(Entity entity, EntityLocController locController)
        {
            List<ActionCommand> actionQueue = entity.getActionQueue();
            if(actionQueue.Count > 0)
            {
                ActionCommand command = actionQueue[0];

                if (command.work())
                {
                    // Action is done, remove and set Entity's state to idle.
                    actionQueue.RemoveAt(0);
                    entity.getState().setPrimaryState(State.PrimaryState.Idle);
                }

                if (entity.entityType == Entity.EntityType.Unit)
                {
                    // Unit may have moved, update it's location in the GameWorld.
                    locController.updateUnitLocation((Unit)entity);
                }
            }
        }
        /// <summary>
        /// The basic outline of the updateEntity method is as follows:
        /// 1, Have the entity perform the current action at the top of it's action queue (if any)
        /// 2, Check for changes in the entity's stats. (ex: check for death.)
        /// 3, Have the Entity react to any Events that occur within it's visibility range.
        /// (Events that either occur to the Entity or events that the Entity can "see")
        /// 4, Check if the Entity should be removed from the game. (When it's primary state is set to Remove.)
        /// </summary>
        /// <param name="entity">Entity being updated.</param>
        /// <param name="entitiesToRemove">List of Entities to be removed.</param>
        private void updateEntity(Entity entity, List<Entity> entitiesToRemove)
        {
            /*** Have entity perform it's current action (if any) ***/
            ActionController.Instance.update(entity, locController);

            Entity.EntityType type = entity.getEntityType();	// Enity's type (Unit, Building, Object or Resource)
            State state = entity.getState();					// Entity's State.

            /*** Update stats of Entity ***/
            if (type == Entity.EntityType.Unit)
            {
                UnitStatsLogic.updateUnit((Unit)entity, curTick);
            }
            else
            {
                // Only Stats update occurs upon death of any StaticEntity right?
                if (entity.health <= 0)
                {
                    state.setPrimaryState(State.PrimaryState.Dead);
                    entity.tickKilled = curTick;
                }
            }

            /*** Have Entity react to any Events ***/
            if (type == Entity.EntityType.Unit) // Only Units really need to react to Events.
            {
                GameEventLogic.processEvents((Unit)entity, scenario.getGameWorld());
            }

            /*** Remove Entity if it needs to be removed. ***/
            if (state.getPrimaryState() == State.PrimaryState.Dead)
            {
                entitiesToRemove.Add(entity);
            }
        }