public PlayerData(ITurnManager turnManager, uint playerId)
    {
        this.turnManager = turnManager;
        this.playerId    = playerId;

        inputState.onShoot += OnShoot;
    }
예제 #2
0
 private static void Write(ITurnManager <string> turnManager)
 {
     while (!turnManager.IsEmpty())
     {
         //Mientras no sea Empty sigo iterando
         Console.WriteLine(turnManager.Get());
     }
 }
예제 #3
0
 /// <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;
 }
예제 #4
0
        //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);
            }
        }
예제 #5
0
        public SkillManager(ICrossPlayerController CrossPlayerController, ITurnManager TurnManager, IHexDatabase HexDatabase)
        {
            this.CrossPlayerController = CrossPlayerController;
            this.TurnManager           = TurnManager;
            this.HexDatabase           = HexDatabase;

            CrossPlayerController.PerformSkillCallback += OnPerformSkillCallback;
            TurnManager.TurnEnded += OnTurnEnded;
        }
예제 #6
0
        public void StartTurn_IsCalled_CreateTurnManager()
        {
            ITurnManager turnManager = Substitute.For <ITurnManager>();

            turnManager.ViableStories = new List <IStory>();

            _gameManager.StartTurn(turnManager);

            Assert.That(!_gameManager.turnManager.Equals(null));
        }
예제 #7
0
        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);
        }
예제 #8
0
        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;
        }
예제 #9
0
        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);
        }
예제 #10
0
        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;
        }
예제 #12
0
 private static void EachNames(ITurnManager <string> turnManager)
 {
     foreach (var item in turnManager)
     {
         if (item == "Juan")
         {
             Console.WriteLine($"**{item}**");
         }
         else
         {
             Console.WriteLine(item);
         }
     }
 }
예제 #13
0
 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);
     }
 }
예제 #14
0
        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);
        }
예제 #15
0
        ///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);
                }
            }
        }
예제 #16
0
        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;
        }
예제 #17
0
 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;
 }
예제 #18
0
파일: Board.cs 프로젝트: sommen01/Seega
 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;
 }
예제 #19
0
 /// <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);
 }
예제 #20
0
 public RoundManager(ITurnManager turnManager)
 {
     this.turnManager = turnManager;
 }
예제 #21
0
 /// <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;
 }
예제 #22
0
 private void Construct(ITurnManager turnManager, EventManager eventManager)
 {
     _eventManager = eventManager;
     _turnManager  = turnManager;
 }
예제 #23
0
 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();
 }
예제 #26
0
 public GameManager(IConsoleWindowContainer windows, ITurnManager turns)
 {
     _turnManager            = turns;
     _consoleWindowContainer = windows;
 }
 public CrossPlayerController(IHexDatabase HexDatabase, ITurnManager TurnManager)
 {
     this.HexDatabase = HexDatabase;
     this.TurnManager = TurnManager;
 }
예제 #28
0
 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;
     }
 }