/// <summary> /// Initialized the game. /// </summary> public void InitializeGame() { #if DEB if (GUIReferences.InputListener == null) { DebugUtil.Error("INPUT LISTENER IS NULL. PLEASE BAKE THE GAME HOLDER!"); } if (GUIReferences.TerminalComponent == null) { DebugUtil.Error("TERMINAL COMPONENT IS NULL. PLEASE BAKE THE GAME HOLDER!"); } #endif Constants.Colors = Colors; DataHolder.DebugCondition = DebugCondition; DataHolder.GUIReferences = GUIReferences; DataHolder.DreamReferences = DreamReferences; DataHolder.GUIReferences.TerminalComponent.Initialize(); StoryUtil.Init(); LoopUtil.Init(); WindowUtil.Initialize(); DataUtil.LoadData(); ProgramUtil.SetupPrograms(); GUIUtil.SetCursorToDefault(); TerminalUtil.HideTerminal(); AnnouncementUtil.HideAnnouncement(); DreamUtil.ExecuteDreamOne(); }
/// <summary> /// Returns true if the given file is avaiable for use. /// </summary> public static bool IsFileAvaibale(HashFile file) { var result = StoryUtil.EvaluateCondition(file.Condition); var permission = GetAccessPermission(file); result = result && permission > AccessPermission.Hidden; return(result); }
/// <summary> /// Creates and returns a text file from the given serialized data. /// </summary> public static HashFile GetTextFileFromSerializedData(SerializedHashFileText serialized) { var file = GetFileFromSerializedData(serialized.File); file.FileType = HashFileType.Text; var txtFile = new TextFile(); txtFile.Story = new Ink.Runtime.Story(serialized.TextAsset.text); StoryUtil.BindExternalFunctions(txtFile.Story); txtFile.EncryptedTextContent = TextUtil.EncryptString(txtFile.Story.ToString()); file.Content = txtFile; return(file); }
public static bool IsDeviceAvailable(HashDevice device) { var result = StoryUtil.EvaluateCondition(device.Condition); return(result); }
public static bool IsProgramAvailable(Program program) { return(StoryUtil.EvaluateCondition(program.Condition)); }