Exemplo n.º 1
0
        internal static void Visualize()
        {
            if (!GameStarted)
            {
                return;
            }
            DefaultMessageRaiser.EarlyVisualize();
            PlayerManager.Visualize();
            MainGameManager.MainInterfacingHelper.Visualize();
            BehaviourHelperManager.Visualize();
            PhysicsManager.Visualize();
            AgentController.Visualize();
            ProjectileManager.Visualize();
            EffectManager.Visualize();

            TeamManager.Visualize();
        }
Exemplo n.º 2
0
        public void Initialize()
        {
            Diplomacy.FastClear();
            for (int i = 0; i < TeamManager.Teams.Count; i++)
            {
                Team team = TeamManager.Teams[i];
                if (team != this)
                {
                    Diplomacy.AddAt(AllegianceType.Neutral, team.ID);
                }
            }
            TeamManager.UpdateDiplomacy(this);
            this.SetAllegiance(this, AllegianceType.Friendly);

            MainController = new AgentController();
            MainController.JoinTeam(this);
        }
Exemplo n.º 3
0
        public static void Simulate()
        {
            if (InfluenceCount == 0)
            {
                InfluenceSimulate();
                InfluenceCount = InfluenceResolution - 1;
                if (FrameManager.CanAdvanceFrame == false)
                {
                    Stalled = true;
                    return;
                }
                Stalled = false;
                FrameManager.Simulate();
                InfluenceFrameCount++;
            }
            else
            {
                InfluenceCount--;
            }
            if (Stalled)
            {
                return;
            }
            if (FrameCount == 0)
            {
                StartGame();
            }
            BehaviourHelper.GlobalSimulate();
            AgentController.Simulate();
            PhysicsManager.Simulate();
            CoroutineManager.Simulate();
            InfluenceManager.Simulate();
            ProjectileManager.Simulate();
            TestManager.Simulate();

            TeamManager.Simulate();

            foreach (LSManager manager in Managers)
            {
                manager.Simulate();
            }

            LateSimulate();
            FrameCount++;
        }
Exemplo n.º 4
0
        internal static void Simulate()
        {
            MainGameManager.MainNetworkHelper.Simulate();
            DefaultMessageRaiser.EarlySimulate();
            if (InfluenceCount == 0)
            {
                InfluenceSimulate();
                InfluenceCount = InfluenceResolution - 1;
                if (FrameManager.CanAdvanceFrame == false)
                {
                    Stalled = true;
                    return;
                }
                Stalled = false;
                if (InfluenceFrameCount == 0)
                {
                    GameStart();
                }
                FrameManager.Simulate();
                InfluenceFrameCount++;
            }
            else
            {
                InfluenceCount--;
            }
            if (Stalled)
            {
                return;
            }

            MainGameManager.MainInterfacingHelper.Simulate();

            BehaviourHelperManager.Simulate();
            AgentController.Simulate();
            PhysicsManager.Simulate();
            CoroutineManager.Simulate();
            InfluenceManager.Simulate();
            ProjectileManager.Simulate();
            TeamManager.Simulate();

            TriggerManager.Simulate();

            LateSimulate();
            FrameCount++;
        }
Exemplo n.º 5
0
        public static void Visualize()
        {
            PlayerManager.Visualize();

            BehaviourHelper.GlobalVisualize();
            PhysicsManager.Visualize();
            AgentController.Visualize();
            ProjectileManager.Visualize();
            EffectManager.Visualize();

            TeamManager.Visualize();

            foreach (LSManager manager in Managers)
            {
                manager.Visualize();
            }

            //LateVisualize ();
        }
        public static void Initialize(GameManager gameManager)
        {
            MainGameManager = gameManager;


            SimulationTimer.Reset();
            SimulationTimer.Start();
            LSDatabaseManager.Initialize();
            LSUtility.Initialize(1);
            Interfacing.Initialize();
            InfluenceCount = 0;
            Time.timeScale = 1f;
            Stalled        = true;

            FrameCount          = 0;
            InfluenceFrameCount = 0;

            GridManager.Generate();
            GridManager.Initialize();

            TeamManager.Initialize();

            CoroutineManager.Initialize();
            FrameManager.Initialize();

            CommandManager.Initialize();
            BehaviourHelper.GlobalInitialize();

            AgentController.Initialize();
            TeamManager.LateInitialize();

            PhysicsManager.Initialize();
            PlayerManager.Initialize();
            SelectionManager.Initialize();
            InfluenceManager.Initialize();
            ProjectileManager.Initialize();

            LoadSceneObjects();

            Started = true;
            ClientManager.Initialize();
        }
Exemplo n.º 7
0
        public static void Deactivate()
        {
            if (Started == false)
            {
                return;
            }
            Selector.Clear();
            AgentController.Deactivate();
            BehaviourHelper.GlobalDeactivate();
            ProjectileManager.Deactivate();
            ClientManager.Deactivate();

            foreach (LSManager manager in Managers)
            {
                manager.Deactivate();
            }

            TeamManager.Deactivate();
            ClientManager.NetworkHelper.Disconnect();
            Started = false;
        }
Exemplo n.º 8
0
        internal static void Deactivate()
        {
            DefaultMessageRaiser.EarlyDeactivate();

            if (Started == false)
            {
                return;
            }
            Selector.Clear();
            AgentController.Deactivate();
            MainGameManager.MainInterfacingHelper.Deactivate();
            BehaviourHelperManager.Deactivate();
            ProjectileManager.Deactivate();
            ClientManager.Deactivate();
            LockstepManager.Deactivate();

            TeamManager.Deactivate();
            ClientManager.NetworkHelper.Disconnect();
            Started = false;

            DefaultMessageRaiser.LateDeactivate();
        }
Exemplo n.º 9
0
        internal static void Deactivate()
        {
            DefaultMessageRaiser.EarlyDeactivate();

            if (GameStarted == false)
            {
                return;
            }
            Selector.Clear();
            AgentController.Deactivate();
            BehaviourHelperManager.Deactivate();
            ProjectileManager.Deactivate();
            EffectManager.Deactivate();
            ClientManager.Deactivate();

            TeamManager.Deactivate();
            ClientManager.Quit();
            PhysicsManager.Deactivate();
            GameStarted = false;
            LSServer.Deactivate();
            DefaultMessageRaiser.LateDeactivate();
        }
        public static void Setup()
        {
            UnityInstance = GameObject.CreatePrimitive(PrimitiveType.Sphere).AddComponent <MonoBehaviour> ();
            UnityInstance.GetComponent <Renderer>().enabled = false;
            GameObject.DontDestroyOnLoad(UnityInstance.gameObject);

            AbilityInterfacer.Setup();

            AgentController.Setup();
            TeamManager.Setup();

            ProjectileManager.Setup();
            EffectManager.Setup();
            BehaviourHelper.GlobalSetup();
            PhysicsManager.Setup();
            ClientManager.Setup(MainGameManager.MainNetworkHelper);
            InterfaceManager.Setup();

            Application.targetFrameRate = 30;
            Time.fixedDeltaTime         = BaseDeltaTime;
            Time.maximumDeltaTime       = Time.fixedDeltaTime * 2;

            InputManager.Setup();
        }