void Awake() { if (movesManager == null) { movesManager = FindObjectOfType <MovesManager>(); } }
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(); }
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); }
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); }
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); }
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); }
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); } }
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(); }
private bool IsMoveOffensive(PokemonMove move, MovesManager.MoveData moveData) { return moveData.Power > 0 || move.Id == DragonRage || move.Id == SeismicToss || move.Id == NightShade || move.Id == Psywave; }
void Awake() { instance = this; }