void Awake()
 {
     if (movesManager == null)
     {
         movesManager = FindObjectOfType <MovesManager>();
     }
 }
예제 #2
0
        static void Main(string[] args)
        {
            var rectangularManager = new RectangularManager();
            var roverManager       = new RoverManager();
            var movesManager       = new MovesManager();

            string rectangular = Console.ReadLine();
            var    rec         = rectangularManager.Rectangular(rectangular);


            string rover = Console.ReadLine();
            var    rov   = roverManager.Rover(rover, rectangular);

            string moves = Console.ReadLine();

            movesManager.Moves(moves, rov);

            string rover2 = Console.ReadLine();
            var    rov2   = roverManager.Rover(rover2, rectangular);

            string moves2 = Console.ReadLine();

            movesManager.Moves(moves2, rov2);

            Console.WriteLine(rov.X + " " + rov.Y + " " + rov.Direction);
            Console.WriteLine(rov2.X + " " + rov2.Y + " " + rov2.Direction);

            Console.ReadLine();
        }
예제 #3
0
        public void MoveForward_X_Success()
        {
            var mv  = new MovesManager();
            var rov = new Rover()
            {
                X         = 1,
                Y         = 2,
                Direction = DirectionsEnum.E
            };

            mv.MoveForward(rov);
            Assert.AreEqual(2, rov.X);
        }
예제 #4
0
        public void TurnRight()
        {
            var mv  = new MovesManager();
            var rov = new Rover()
            {
                X         = 1,
                Y         = 2,
                Direction = DirectionsEnum.N
            };

            mv.TurnRight(rov);
            Assert.AreEqual(DirectionsEnum.E, rov.Direction);
        }
예제 #5
0
        public void Moves_WhenCorrectInput_Success()
        {
            var mv  = new MovesManager();
            var rov = new Rover()
            {
                X         = 1,
                Y         = 2,
                Direction = DirectionsEnum.N
            };

            mv.Moves("LMR", rov);
            mv.Moves("MMLM", rov);
            mv.Moves("MMLMMR", rov);
        }
예제 #6
0
        public void Moves_WhenWrongInput_Error()
        {
            var mv  = new MovesManager();
            var rov = new Rover()
            {
                X         = 1,
                Y         = 2,
                Direction = DirectionsEnum.N
            };

            mv.Moves("LMRS", rov);
            mv.Moves("esloR", rov);
            mv.Moves("omc", rov);
        }
예제 #7
0
    void GenerateUfo()
    {
        for (int i = 0; i < numberOfUfos; i++)
        {
            MovesManager moves = ufo.GetComponent(typeof(MovesManager)) as MovesManager;
            moves.startPosition = new Vector3(
                Random.Range(ContenxtInfo.LeftBorder, ContenxtInfo.RightBorder),
                Random.Range(-5.4f, -4.0f)
                , 0);

            ufo.tag = "ufo";
            ufo.transform.rotation = new Quaternion(0, 0, 0, 0);
            Instantiate(ufo);
        }
    }
예제 #8
0
    void Init()
    {
        if (currentPlayerProfile == null)
        {
            currentPlayerProfile = new PlayerProfile();
        }

        if (gameStateManager == null)
        {
            gameStateManager = new GameStateManager();
        }

        if (facebookManager == null)
        {
            facebookManager = new FacebookManager();
        }

        if (movesManager == null)
        {
            movesManager = MovesManager.instance;
        }

        if (inputManager == null)
        {
            inputManager = InputManager.instance;
        }

        if (audioManager == null)
        {
            audioManager = AudioManager.instance;
        }

        gameStateManager.Init();
        facebookManager.Init();
        inputManager.Init();
    }
예제 #9
0
파일: BattleAI.cs 프로젝트: Rympex/proshine
 private bool IsMoveOffensive(PokemonMove move, MovesManager.MoveData moveData)
 {
     return moveData.Power > 0 || move.Id == DragonRage || move.Id == SeismicToss || move.Id == NightShade || move.Id == Psywave;
 }
예제 #10
0
 void Awake()
 {
     instance = this;
 }