static void Main(string[] args) { Console.WriteLine("Welcome to Snake Ladder Problem"); int roll; MovementLogic ml = new MovementLogic(); //Use Case 1 Player player = ml.InitialisePlayer(); //Use Case 2 roll = new MovementLogic().RollDice(); Console.WriteLine("Player " + player.getName() + " has rolled a " + roll); //Use Case 3 Console.WriteLine("Player " + player.getName() + " gets " + ml.MovePlayer(player, roll) + " gets to " + player.getPosition()); //Use Case 4,5,6 ml.PlayGame(player); Player player2 = ml.InitialisePlayer(); //Use Case 7 ml.Play2PlayerGame(player, player2); //Temp Read Line Console.ReadLine(); }
public void Setup() { _coordinatesLogicMock = new Mock <ICoordinatesLogic>(); _healthLogicMock = new Mock <IHealthLogic>(); _animalLogicMock = new Mock <IAnimalLogic>(); _movementLogic = new MovementLogic(_coordinatesLogicMock.Object, _healthLogicMock.Object, _animalLogicMock.Object); }
public void Move() { if (HealthLeft > 0) { MovementLogic.Move(); } else { Console.WriteLine("Unit dead"); } }
// Get tiles world data logic #region public static List <Tile> GetAllValidMoveableTilesForEntities(World world) { // This method checks every tile in a world object, and returns all tiles // that a living entity is able to move onto and over List <Tile> tilesReturned = new List <Tile>(); foreach (Tile tile in GetAllTilesFromWorldDictionary(world)) { if (MovementLogic.IsLocationMoveable(tile)) { tilesReturned.Add(tile); } } return(tilesReturned); }
public static List <Tile> GetAllValidNewItemLocationTiles(World world) { // This method checks every tile in a world object, and returns all tiles // that would be a valid location to create a new item. List <Tile> tilesReturned = new List <Tile>(); foreach (Tile tile in GetAllTilesFromWorldDictionary(world)) { if (MovementLogic.IsLocationMoveable(tile) && tile.MyItem == null) { tilesReturned.Add(tile); } } return(tilesReturned); }
public void Init() { if (gameObject.HasComponent <Animator>()) { animPlayer = GetComponent <Animator>(); } else { throw new NotImplementedException("Generating Animator dynamically not supported. Add Animator with animations first."); } tilemap = mapGrid.GetComponentInChildren <Tilemap>(); movePoint.parent = null; moveLogic = new MovementLogic(moveSpeed, mapGrid, movePoint, direction, animPlayer, gameObject); startingPosition = transform.position; startingDirection = moveLogic.direction; }
/// <summary> /// Calling before start. /// </summary> private void Awake() { // Get scripts and components. _actionJumpLogicScript = GameObject.FindGameObjectWithTag("Player").GetComponent <ActionJumpLogic>(); _movementLogicScript = GameObject.FindGameObjectWithTag("Player").GetComponent <MovementLogic>(); }
/// <summary> /// Calling before start. /// </summary> private void Awake() { // Get scripts and components. _joystickScript = GetComponent <Joystick>(); _movementLogicScript = FindObjectOfType <MovementLogic>(); }
// Start is called before the first frame update void Start() { objectMovementLogic = this.gameObject.GetComponent <MovementLogic>(); animBody = this.gameObject.GetComponent <Animator>(); }
/// <summary> /// Calling before start. /// </summary> private void Awake() { // Get scripts and components. _actionJumpLogicScript = FindObjectOfType <ActionJumpLogic>(); _movementLogicScript = FindObjectOfType <MovementLogic>(); }
/// <summary> /// Calling before start. /// </summary> private void Awake() { // Get scripts and components. _joystickScript = GetComponent <Joystick>(); _movementLogicScript = GameObject.FindGameObjectWithTag("Player").GetComponent <MovementLogic>(); }
void Awake() { board = new BoardArray(transform.position); logic = new MovementLogic(board); }
// Perform specific abilities logic #region public static void PerformMove(LivingEntity caster, Tile destination) { MovementLogic.MoveEntity(caster, destination); }
private void Awake() { Instance = this; }
private void Awake() { movementLogic = GetComponent <MovementLogic>(); movementAnimator = GetComponent <Animator>(); }