Esempio n. 1
0
 internal void init(ScenarioLoader loader)
 {
     foreach (var bodyName in common)
     {
         bodies[bodyName] = loader.GetCelestialBodyDefinition(bodyName);
     }
 }
Esempio n. 2
0
 public ScenarioController(ITAlertPhotonClient photonClient, CreateGameController createGameController)
 {
     _photonClient                  = photonClient;
     _scenarioLoader                = new ScenarioLoader();
     _createGameController          = createGameController;
     _photonClient.JoinedRoomEvent += OnJoinedRoom;
 }
Esempio n. 3
0
 public InitializingState(Director director, InitializingStateInput input, ITAlertPhotonClient photonClient)
     : base(input)
 {
     _director       = director;
     _photonClient   = photonClient;
     _scenarioLoader = new ScenarioLoader();
 }
Esempio n. 4
0
        private static ScenarioData loadLinkData(String href)
        {
            var path  = FilePathSearcher.FindPath(FilePathSearcher.FileType.Scenario, href);
            var bytes = File.ReadAllBytes(path);
            var text  = GetEncoding.GetCode(bytes).GetString(bytes);

            var scenarioData = ScenarioLoader.LoadFromText(text);

            return(scenarioData);
        }
Esempio n. 5
0
 public GameState(PluginBase photonPlugin,
                  Messenger messenger,
                  ITAlertPlayerManager playerManager,
                  RoomSettings roomSettings,
                  AnalyticsServiceManager analytics,
                  ExceptionHandler exceptionHandler)
     : base(photonPlugin, messenger, playerManager, roomSettings, analytics)
 {
     _scenarioLoader   = new ScenarioLoader();
     _exceptionHandler = exceptionHandler;
 }
Esempio n. 6
0
 void Start()
 {
     if (leftHandController != null)
     {
         var controller_l = leftHandController.GetComponent <SteamVR_TrackedObject>();
         _device_L = SteamVR_Controller.Input((int)controller_l.index);
     }
     if (rightHandController != null)
     {
         var controller_r = rightHandController.GetComponent <SteamVR_TrackedObject>();
         _device_R = SteamVR_Controller.Input((int)controller_r.index);
     }
     _scenarioLoader = GetComponent <ScenarioLoader>();
 }
Esempio n. 7
0
        public void Initialize()
        {
            gameManager      = GetComponent <GameManager>();
            scenarioLoader   = GetComponent <ScenarioLoader>();
            uiHandler        = GetComponent <UIHandler>();
            selectionManager = GetComponent <SelectionManager>();

            if (Application.platform == RuntimePlatform.WebGLPlayer)
            {
                quitButton.SetActive(false);
                settingsButton.transform.position = quitButton.transform.position;
            }

            uiHandler.DisableInputs();

            activeSection = 0;

            AdvanceSection();
        }
Esempio n. 8
0
    private void Start()
    {
        Time.timeScale = 1;

        if (inst)
        {
            Destroy(inst.gameObject);
        }
        else
        {
            inst = this;
        }

        if (!GameManager.instance)
        {
            Debug.LogError("No GameManager found. Unable to load.");
            Destroy(this);
        }

        GameManager.instance.activeScenarioLoader = this;
        Scenario data = GameManager.instance.GetActiveScenario();

        preMessages  = new List <string>();
        postMessages = new List <string>();

        SpawnParty();

        title.text       = data.scenarioName;
        description.text = data.description;

        //check for pre-conditions
        if (data.preConditions.Count > 0)
        {
            bool warningTextLoaded = false;
            foreach (ScenarioEvent a in data.preConditions)
            {
                Action myMethod = MethodsMasterList.instance.masterList[a.eventMethodName];
                if (myMethod == null)
                {
                    Debug.LogError("no method found", gameObject);
                }
                else if (a.eventMethodName == "nothing")
                {
                    Debug.LogWarning("'nothing' method loaded, this action will not do anything", gameObject);
                }
                else
                {
                    if (!warningTextLoaded)
                    {
                        if (a.partyCondition != EntityStatusEffect.None)
                        {
                            foreach (GameObject partyM in party)
                            {
                                if (partyM.GetComponent <PartyMember>().statusEffects.Contains(a.partyCondition))
                                {
                                    warning.gameObject.SetActive(true);
                                    warning.text      = a.description;
                                    warningTextLoaded = true;
                                    break;
                                }
                            }
                        }
                        else if (a.locationCondition != LocationStatusEffect.None)
                        {
                            if (GameManager.instance.activeLocationEffects.Contains(a.locationCondition))
                            {
                                warning.gameObject.SetActive(true);
                                warning.text      = a.description;
                                warningTextLoaded = true;
                            }
                        }
                        else if (GameManager.instance.tutorial)
                        {
                            warning.gameObject.SetActive(true);
                            warning.text      = a.description;
                            warningTextLoaded = true;
                        }
                    }

                    myMethod();
                }
            }
        }

        //check for post-conditions
        if (data.postConditions.Count > 0)
        {
            postActions = new List <Action>();

            foreach (ScenarioEvent a in data.postConditions)
            {
                Action myMethod = MethodsMasterList.instance.masterList[a.eventMethodName];
                if (myMethod == null)
                {
                    Debug.LogError("no method found", gameObject);
                }
                else if (a.eventMethodName == "nothing")
                {
                    Debug.LogWarning("'nothing' method loaded, this action will not do anything", gameObject);
                }
                else
                {
                    postActions.Add(myMethod);
                }
            }
        }

        for (int i = 0; i < data.prompts.Count; i++)
        {
            buttons[i].gameObject.SetActive(true);
            buttons[i].InputData(data.prompts[i].stylizedName, data.prompts[i].methodName, data.prompts[i].manaCost);
        }
    }
Esempio n. 9
0
 public TutorialAI(TutorialManager tutorialManager, SelectionManager selectionManager, ScenarioLoader scenarioLoader)
 {
     this.tutorialManager  = tutorialManager;
     this.selectionManager = selectionManager;
     this.scenarioLoader   = scenarioLoader;
 }