public Entity AddInputMove(Assets.TilePos newDirection)
        {
            var componentPool = GetComponentPool(GameComponentIds.InputMove);
            var component     = (Assets.Input.InputMoveComponent)(componentPool.Count > 0 ? componentPool.Pop() : new Assets.Input.InputMoveComponent());

            component.Direction = newDirection;
            return(AddComponent(GameComponentIds.InputMove, component));
        }
Exemple #2
0
        public Entity AddPosition(Assets.TilePos newValue)
        {
            var componentPool = GetComponentPool(GameComponentIds.Position);
            var component     = (Assets.PositionComponent)(componentPool.Count > 0 ? componentPool.Pop() : new Assets.PositionComponent());

            component.Value = newValue;
            return(AddComponent(GameComponentIds.Position, component));
        }
        public Entity ReplaceInputPullItem(Assets.TilePos newDirection)
        {
            var componentPool = GetComponentPool(GameComponentIds.InputPullItem);
            var component     = (Assets.Input.InputPullItemComponent)(componentPool.Count > 0 ? componentPool.Pop() : new Assets.Input.InputPullItemComponent());

            component.Direction = newDirection;
            ReplaceComponent(GameComponentIds.InputPullItem, component);
            return(this);
        }
        public Entity AddKnocked(Assets.TilePos newFromDirection, bool newImmediate, float newWait)
        {
            var componentPool = GetComponentPool(GameComponentIds.Knocked);
            var component     = (Assets.KnockedComponent)(componentPool.Count > 0 ? componentPool.Pop() : new Assets.KnockedComponent());

            component.FromDirection = newFromDirection;
            component.Immediate     = newImmediate;
            component.Wait          = newWait;
            return(AddComponent(GameComponentIds.Knocked, component));
        }