public PlayerData(ITurnManager turnManager, uint playerId) { this.turnManager = turnManager; this.playerId = playerId; inputState.onShoot += OnShoot; }
private static void Write(ITurnManager <string> turnManager) { while (!turnManager.IsEmpty()) { //Mientras no sea Empty sigo iterando Console.WriteLine(turnManager.Get()); } }
/// <summary> /// Creates an arena with the specified number of teams fighting in it. /// </summary> /// <param name="numberOfTeams">The number of teams fighting in the arena.</param> /// <param name="turnManager">The object that manages the turns in this arena.</param> /// <exception cref="ArgumentNullException">Thrown when turnManager is null.</exception> public Arena(uint numberOfTeams, ITurnManager turnManager) { if (turnManager == null) { throw new ArgumentNullException(nameof(turnManager)); } teams = new ITeam[numberOfTeams]; TurnManager = turnManager; }
//TODO: 03 - Genero un metodo que se encargue de listar y transformar private static void Write <T>(ITurnManager <string> turnManager) { var listParser = turnManager.ToEnumerable <T>(); foreach (var item in listParser) { Console.WriteLine(item); } }
public SkillManager(ICrossPlayerController CrossPlayerController, ITurnManager TurnManager, IHexDatabase HexDatabase) { this.CrossPlayerController = CrossPlayerController; this.TurnManager = TurnManager; this.HexDatabase = HexDatabase; CrossPlayerController.PerformSkillCallback += OnPerformSkillCallback; TurnManager.TurnEnded += OnTurnEnded; }
public void StartTurn_IsCalled_CreateTurnManager() { ITurnManager turnManager = Substitute.For <ITurnManager>(); turnManager.ViableStories = new List <IStory>(); _gameManager.StartTurn(turnManager); Assert.That(!_gameManager.turnManager.Equals(null)); }
public void StartTurn_IsCalled_GetsViableStories() { ITurnManager turnManager = Substitute.For <ITurnManager>(); turnManager.ViableStories = new List <IStory>(); _gameManager.StartTurn(turnManager); turnManager.Received().GetViableStories(_gameManager.BaseData, _gameManager.GameData); }
public EnemyAI(ICrossPlayerController CrossPlayerController, ITurnManager TurnManager, IHexPathfinder HexPathfinder, IUnitMovementManager UnitMovementManager) { this.CrossPlayerController = CrossPlayerController; this.TurnManager = TurnManager; this.HexPathfinder = HexPathfinder; this.UnitMovementManager = UnitMovementManager; TurnManager.TurnStarted += OnTurnStarted; UnitMovementManager.UnitPositionChangeEnd += OnUnitPositionChangeEnd; }
public void StartTurn_HasViableStories_BeginsTurn() { ITurnManager turnManager = Substitute.For <ITurnManager>(); turnManager.ViableStories = new List <IStory>(); turnManager.ViableStories.Add(new Story()); _gameManager.StartTurn(turnManager); turnManager.Received().BeginTurn(_gameManager.BaseData, _gameManager.GameData); }
public TurnOwnerHighlight(ITurnManager TurnManager, IHexHighlighter HexHighlighter, IUnitMovementManager UnitMovementManager) { this.HexHighlighter = HexHighlighter; this.TurnManager = TurnManager; this.UnitMovementManager = UnitMovementManager; TurnManager.TurnStarted += OnTurnStarted; TurnManager.TurnEnded += OnTurnEnded; UnitMovementManager.UnitPositionChange += OnUnitPositionChange; UnitMovementManager.UnitPositionChangeEnd += OnUnitPositionChangeEnd; }
public UnitSelectionManager(ISelectionManager SelectionManager, IHexPathfinder HexPathfinder, IHexDatabase HexDatabase, ITurnManager TurnManager, ICrossPlayerController CrossPlayerController) { this.SelectionManager = SelectionManager; this.HexPathfinder = HexPathfinder; this.HexDatabase = HexDatabase; this.TurnManager = TurnManager; this.CrossPlayerController = CrossPlayerController; TurnManager.TurnStarted += OnTurnStarted; SelectionManager.SelectableSelected += OnSelectableSelected; SelectionManager.SelectableUnselected += OnSelectableUnselected; }
private static void EachNames(ITurnManager <string> turnManager) { foreach (var item in turnManager) { if (item == "Juan") { Console.WriteLine($"**{item}**"); } else { Console.WriteLine(item); } } }
public void StartTurn(ITurnManager turnManager) { this.turnManager = turnManager; turnManager.EndTurn += EndTurn; turnManager.GetViableStories(BaseData, GameData); if (turnManager.ViableStories.Count == 0) { EndGame(); } else { turnManager.BeginTurn(BaseData, GameData); } }
public void CreateSomeUnit() { Container = TestUtility.CreateContainer(); HexDatabase = Container.Resolve <IHexDatabase>(); TurnManager = Container.Resolve <ITurnManager>(); SelectionManager = Container.Resolve <ISelectionManager>(); UnitAttackManager = Container.Resolve <IUnitAttackManager>(); UnitSelectionManager = Container.Resolve <IUnitSelectionManager>(); CrossPlayerController = Container.Resolve <ICrossPlayerController>(); m_Unit0 = TestUtility.CreateUnit(new int2(0, 0), 0); m_Unit1 = TestUtility.CreateUnit(new int2(2, 0), 1); HexDatabase.AddNewSelectable(m_Unit0); HexDatabase.AddNewSelectable(m_Unit1); }
///Metodo de lectura de lineas private static void Read(ITurnManager <string> turnManager) { while (true) { //Itero y leo lo que el usuario ingresa var value = Console.ReadLine(); if (string.IsNullOrWhiteSpace(value)) { break; } else { turnManager.Add(value); } } }
public SelectableHexHighlights(IMouseInputManager UserInputManager, ISelectionManager SelectionManager, IHexHighlighter HexHighlighter, ITurnManager TurnManager) { this.UserInputManager = UserInputManager; this.HexHighlighter = HexHighlighter; this.SelectionManager = SelectionManager; this.TurnManager = TurnManager; SelectionManager.HexSelected += OnHexSelected; SelectionManager.HexUnselected += OnHexUnselected; SelectionManager.SelectableSelected += SelectableSelected; SelectionManager.SelectableUnselected += OnSelectableUnselected; UserInputManager.HexPressedDown += OnHexPressedDown; UserInputManager.MouseReleased += OnMouseReleased; UserInputManager.HexUnderMouseChanged += OnHexUnderMouseChanged; }
private void Construct(PhysicsCache physicsCache, EventManager eventManager, IRayProvider rayProvider, ISelector2D selector, IPieceProvider pieceProvider, IGameFinisher gameFinisher, IPhaseManager phaseManager, ITurnManager turnManager, IMovementValidator movementValidator) { _physicsCache = physicsCache; _eventManager = eventManager; _rayProvider = rayProvider; _selector = selector; _pieceProvider = pieceProvider; _gameFinisher = gameFinisher; _phaseManager = phaseManager; _turnManager = turnManager; _movementValidator = movementValidator; }
private void Construct(PhysicsCache physicsCache, EventManager eventManager, IRayProvider rayProvider, ISelector selector, IFieldProvider fieldProvider, IPieceProvider pieceProvider, ICaptureVerifier captureVerifier, IGameFinisher gameFinisher, IPhaseManager phaseManager, ITurnManager turnManager, IWallVerifier wallVerifier) { _physicsCache = physicsCache; _eventManager = eventManager; _rayProvider = rayProvider; _selector = selector; _fieldProvider = fieldProvider; _pieceProvider = pieceProvider; _captureVerifier = captureVerifier; _gameFinisher = gameFinisher; _phaseManager = phaseManager; _turnManager = turnManager; _wallVerifier = wallVerifier; }
/// <summary> /// Sets the turn manager that this arena will use. /// </summary> /// <param name="manager">The scheme for determining the granularity and order of turns.</param> /// <returns>The ArenaBuilder for chaining.</returns> public ArenaBuilder <T> SetTurnManager(ITurnManager manager) { turnManager = manager; return(this); }
public RoundManager(ITurnManager turnManager) { this.turnManager = turnManager; }
/// <summary> /// Creates a named arena with the specified number of teams fighting in it. /// </summary> /// <param name="name">The name of the arena.</param> /// <param name="numberOfTeams">The number of teams fighting in the arena.</param> /// <param name="turnManager">The object that manages the turns in this arena.</param> public Arena(string name, uint numberOfTeams, ITurnManager turnManager) : this(numberOfTeams, turnManager) { ArenaName = name; }
private void Construct(ITurnManager turnManager, EventManager eventManager) { _eventManager = eventManager; _turnManager = turnManager; }
public void Init(ITurnManager turnManager) { _turnManager = turnManager; }
public TurnManagerViewModel(ITurnManager turnManager) { _turnManager = turnManager; _turnManager.PropertyChanged += HandleTurnManagerPropertyChanged; FinishCurrentPhaseCommand = new Command(() => _turnManager.FinishCurrentPhase()); }
public void GetNextPhase(ITurnManager manager) { throw new System.NotImplementedException(); }
public GameManager(IConsoleWindowContainer windows, ITurnManager turns) { _turnManager = turns; _consoleWindowContainer = windows; }
public CrossPlayerController(IHexDatabase HexDatabase, ITurnManager TurnManager) { this.HexDatabase = HexDatabase; this.TurnManager = TurnManager; }
private static void TurnManager_OnPhaseChanged(ITurnPhase fromPhase, ITurnPhase toPhase, ITurnManager turnManager) { if (toPhase is EnemyPhase ePhase) { currentTeam = ePhase.EnemyTeam; } else if (toPhase is PlayerPhase pPhase) { currentTeam = pPhase.PlayerTeam; } }