private static void FinishSubPhase()
        {
            HideSubphaseDescription();

            Board.ToggleObstaclesHolder(false);
            ObstaclesManager.SetObstaclesCollisionDetectionQuality(CollisionDetectionQuality.High);

            GenericSubPhase subphase = Phases.StartTemporarySubPhaseNew("Notification", typeof(NotificationSubPhase), StartSetupPhase);

            (subphase as NotificationSubPhase).TextToShow = "Setup";
            subphase.Start();
        }
        public ShipObstacleDistance(GenericShip ship, GenericObstacle obstacle)
        {
            CollisionDetectionQuality currentQuality = ObstaclesManager.CollisionDetectionQuality;

            ObstaclesManager.SetObstaclesCollisionDetectionQuality(CollisionDetectionQuality.Low);
            Ship     = ship;
            Obstacle = obstacle;

            if (!CheckDistanceSimple())
            {
                CheckDistanceAdvanced();
            }
            ObstaclesManager.SetObstaclesCollisionDetectionQuality(currentQuality);
        }
Ejemplo n.º 3
0
        private static void FinishSubPhase()
        {
            HideSubphaseDescription();

            Board.ToggleObstaclesHolder(false);
            Roster.SetRaycastTargets(true);
            ObstaclesManager.SetObstaclesCollisionDetectionQuality(CollisionDetectionQuality.High);

            Action callback = Phases.CurrentSubPhase.CallBack;

            Phases.CurrentSubPhase = Phases.CurrentSubPhase.PreviousSubPhase;
            //Phases.CurrentSubPhase.Resume();
            callback();
        }
Ejemplo n.º 4
0
        public override void Initialize()
        {
            RequiredPlayer = Selection.ThisShip.Owner.PlayerNo;

            MinBoardEdgeDistance = Board.BoardIntoWorld(2 * Board.RANGE_1);
            MinObstaclesDistance = Board.BoardIntoWorld(Board.RANGE_1);

            ChosenObstacle.IsPlaced = false;

            Board.ToggleObstaclesHolder(true);
            Roster.SetRaycastTargets(false);

            ObstaclesManager.SetObstaclesCollisionDetectionQuality(CollisionDetectionQuality.Low);

            IsReadyForCommands = true;
            Roster.GetPlayer(RequiredPlayer).MoveObstacleMidgame();
        }
        public override void Initialize()
        {
            ShowObstaclesHolder();

            MinBoardEdgeDistance = Board.BoardIntoWorld(2 * Board.RANGE_1);
            MinObstaclesDistance = Board.BoardIntoWorld(Board.RANGE_1);

            RequiredPlayer = Roster.AnotherPlayer(Phases.PlayerWithInitiative); // Will be changed in Next
            ChosenObstacle = null;

            foreach (GenericPlayer player in Roster.Players)
            {
                if (player.PlayerType == PlayerType.Ai)
                {
                    IsRandomSetupSelected[player.PlayerNo] = true;
                }
            }

            ObstaclesManager.SetObstaclesCollisionDetectionQuality(CollisionDetectionQuality.Low);

            Next();
        }