Пример #1
0
        public Character GetForward()
        {
            Game game = Game.GetInstance();

            if (faceTo == Direction.Left)
            {
                if (posInAxis - 1 > 10 || posInAxis - 1 < 0)
                {
                    return(null);
                }
                return(game.getItemInAxisAt(posInAxis - 1));
            }
            else
            {
                if (posInAxis + 1 > 10 || posInAxis + 1 < 0)
                {
                    return(null);
                }
                return(game.getItemInAxisAt(posInAxis + 1));
            }
        }