• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Types.Game类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AGS.Types.Game的典型用法代码示例。如果您正苦于以下问题:C# Game类的具体用法?C# Game怎么用?C# Game使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Game类属于AGS.Types命名空间,在下文中一共展示了Game类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: NumberSpeechLines

        public CompileMessages NumberSpeechLines(Game game, bool includeNarrator, bool combineIdenticalLines, bool removeNumbering, int? characterID)
        {
            _speechableFunctionCalls = GetFunctionCallsToProcessForSpeech(includeNarrator);

            _errors = new CompileMessages();
            _game = game;
            _includeNarrator = includeNarrator;
            _combineIdenticalLines = combineIdenticalLines;
            _removeNumbering = removeNumbering;
            _characterID = characterID;

            if (Factory.AGSEditor.AttemptToGetWriteAccess(SPEECH_REFERENCE_FILE_NAME))
            {
                using (_referenceFile = new StreamWriter(SPEECH_REFERENCE_FILE_NAME, false))
                {
                    _referenceFile.WriteLine("// AGS auto-numbered speech lines output. This file was automatically generated.");
                    PerformNumbering(game);
                }
            }
            else
            {
                _errors.Add(new CompileError("unable to create file " + SPEECH_REFERENCE_FILE_NAME));
            }

            return _errors;
        }
开发者ID:smarinel,项目名称:ags-web,代码行数:26,代码来源:SpeechLinesNumbering.cs


示例2: PerformNumbering

        private void PerformNumbering(Game game)
        {
            SpeechLineProcessor processor = new SpeechLineProcessor(game, _includeNarrator,
                _combineIdenticalLines, _removeNumbering, _characterID, _speechableFunctionCalls, _errors, _referenceFile);

            foreach (Dialog dialog in game.Dialogs)
            {
                foreach (DialogOption option in dialog.Options)
                {
                    if (option.Say)
                    {
                        option.Text = processor.ProcessText(option.Text, GameTextType.DialogOption, game.PlayerCharacter.ID);
                    }
                }

                dialog.Script = processor.ProcessText(dialog.Script, GameTextType.DialogScript);
            }

            foreach (Script script in game.Scripts)
            {
                if (!script.IsHeader)
                {
                    script.Text = processor.ProcessText(script.Text, GameTextType.Script);
                }
            }

            for (int i = 0; i < game.GlobalMessages.Length; i++)
            {
                game.GlobalMessages[i] = processor.ProcessText(game.GlobalMessages[i], GameTextType.Message, Character.NARRATOR_CHARACTER_ID);
            }

            Factory.AGSEditor.RunProcessAllGameTextsEvent(processor, _errors);
        }
开发者ID:smarinel,项目名称:ags-web,代码行数:33,代码来源:SpeechLinesNumbering.cs


示例3: VoiceActorScriptProcessor

 public VoiceActorScriptProcessor(Game game, CompileMessages errors,
     Dictionary<string, FunctionCallType> speechableFunctionCalls)
     : base(game, errors, false, false, speechableFunctionCalls)
 {
     _linesByCharacter = new Dictionary<int, Dictionary<string, string>>();
     _linesInOrder = new List<GameTextLine>();
 }
开发者ID:smarinel,项目名称:ags-web,代码行数:7,代码来源:VoiceActorScriptProcessor.cs


示例4: GameSpeechProcessor

 public GameSpeechProcessor(Game game, CompileMessages errors, bool makesChanges, bool processHotspotAndObjectDescriptions)
 {
     _game = game;
     _errors = errors;
     _makesChanges = makesChanges;
     _processHotspotAndObjectDescriptions = processHotspotAndObjectDescriptions;
 }
开发者ID:sonneveld,项目名称:agscj,代码行数:7,代码来源:GameSpeechProcessor.cs


示例5: ConvertGameDialogScripts

        public string ConvertGameDialogScripts(Game game, CompileMessages errors, bool rebuildAll)
        {
            int stringBuilderCapacity = 1000 * game.RootDialogFolder.GetAllItemsCount() + _DefaultDialogScriptsScript.Length;
            StringBuilder sb = new StringBuilder(_DefaultDialogScriptsScript, stringBuilderCapacity);

            foreach (Dialog dialog in game.RootDialogFolder.AllItemsFlat)
            {
                sb.AppendLine(AGS.CScript.Compiler.Constants.NEW_SCRIPT_MARKER + "Dialog " + dialog.ID + "\"");

                if ((dialog.CachedConvertedScript == null) ||
                    (dialog.ScriptChangedSinceLastConverted) ||
                    (rebuildAll))
                {
                    int errorCountBefore = errors.Count;
                    this.ConvertDialogScriptToRealScript(dialog, game, errors);

                    if (errors.Count > errorCountBefore)
                    {
                        dialog.ScriptChangedSinceLastConverted = true;
                    }
                    else
                    {
                        dialog.ScriptChangedSinceLastConverted = false;
                    }
                }

                sb.Append(dialog.CachedConvertedScript);
            }

            return sb.ToString();
        }
开发者ID:Aquilon96,项目名称:ags,代码行数:31,代码来源:DialogScriptConverter.cs


示例6: Show

 public static DialogResult Show(GlobalVariable variable, Game game)
 {
     GlobalVariableDialog dialog = new GlobalVariableDialog(variable, game);
     DialogResult result = dialog.ShowDialog();
     dialog.Dispose();
     return result;
 }
开发者ID:smarinel,项目名称:ags-web,代码行数:7,代码来源:GlobalVariableDialog.cs


示例7: ForEachViewFolder

 public static void ForEachViewFolder(IViewFolder parentFolder, Game game, ViewFolderProcessing proc)
 {
     foreach (ViewFolder subFolder in parentFolder.SubFolders)
     {
         proc(subFolder, game);
     }
 }
开发者ID:Aquilon96,项目名称:ags,代码行数:7,代码来源:FolderHelper.cs


示例8: ConvertDialogScriptToRealScript

        public void ConvertDialogScriptToRealScript(Dialog dialog, Game game, CompileMessages errors)
        {
            string thisLine;
            _currentlyInsideCodeArea = false;
            _hadFirstEntryPoint = false;
            _game = game;
            _currentDialog = dialog;
            _existingEntryPoints.Clear();
            _currentLineNumber = 0;

            StringReader sr = new StringReader(dialog.Script);
            StringWriter sw = new StringWriter();
            sw.Write(string.Format("function _run_dialog{0}(int entryPoint) {1} ", dialog.ID, "{"));
            while ((thisLine = sr.ReadLine()) != null)
            {
                _currentLineNumber++;
                try
                {
                    ConvertDialogScriptLine(thisLine, sw, errors);
                }
                catch (CompileMessage ex)
                {
                    errors.Add(ex);
                }
            }
            if (_currentlyInsideCodeArea)
            {
                sw.WriteLine("}");
            }
            sw.WriteLine("return RUN_DIALOG_RETURN; }"); // end the function
            dialog.CachedConvertedScript = sw.ToString();
            sw.Close();
            sr.Close();
        }
开发者ID:Aquilon96,项目名称:ags,代码行数:34,代码来源:DialogScriptConverter.cs


示例9: CharactersEditorFilter

 public CharactersEditorFilter(Panel displayPanel, Room room, Game game)
 {
     _room = room;
     _panel = displayPanel;
     _game = game;
     _propertyObjectChangedDelegate = new GUIController.PropertyObjectChangedHandler(GUIController_OnPropertyObjectChanged);
 }
开发者ID:Aquilon96,项目名称:ags,代码行数:7,代码来源:CharactersEditorFilter.cs


示例10: NewRoomDialog

 internal NewRoomDialog(Game game, List<RoomTemplate> templates)
 {
     InitializeComponent();
     _templates = templates;
     _imageList.ImageSize = new Size(32, 32);
     _imageList.Images.Add("_default", Resources.ResourceManager.GetIcon("template_noicon.ico"));
     foreach (RoomTemplate template in templates)
     {
         ListViewItem newItem = lstRoomTemplates.Items.Add(template.FriendlyName);
         if (template.Icon != null)
         {
             _imageList.Images.Add(template.FileName, template.Icon);
             newItem.ImageKey = template.FileName;
         }
         else
         {
             newItem.ImageKey = "_default";
         }
     }
     lstRoomTemplates.LargeImageList = _imageList;
     lstRoomTemplates.Items[0].Selected = true;
     lstRoomTemplates.Items[0].Focused = true;
     _game = game;
     _chosenRoomNumber = -1;
     PickFirstAvailableRoomNumber();
 }
开发者ID:smarinel,项目名称:ags-web,代码行数:26,代码来源:NewRoomDialog.cs


示例11: ProcessAllGameText

        public static void ProcessAllGameText(IGameTextProcessor processor, Game game, CompileMessages errors)
        {
            foreach (Dialog dialog in game.RootDialogFolder.AllItemsFlat)
            {
                foreach (DialogOption option in dialog.Options)
                {
                    option.Text = processor.ProcessText(option.Text, GameTextType.DialogOption, game.PlayerCharacter.ID);
                }

                dialog.Script = processor.ProcessText(dialog.Script, GameTextType.DialogScript);
            }

            foreach (ScriptAndHeader script in game.RootScriptFolder.AllItemsFlat)
            {                                
                string newScript = processor.ProcessText(script.Script.Text, GameTextType.Script);
                if (newScript != script.Script.Text)
                {
                    // Only cause it to flag Modified if we changed it
                    script.Script.Text = newScript;
                }                
            }

            foreach (GUI gui in game.RootGUIFolder.AllItemsFlat)
            {
                foreach (GUIControl control in gui.Controls)
                {
                    GUILabel label = control as GUILabel;
                    if (label != null)
                    {
                        label.Text = processor.ProcessText(label.Text, GameTextType.ItemDescription);
                    }
                    else
                    {
                        GUIButton button = control as GUIButton;
                        if (button != null)
                        {
                            button.Text = processor.ProcessText(button.Text, GameTextType.ItemDescription);
                        }
                    }
                }
            }

            foreach (Character character in game.RootCharacterFolder.AllItemsFlat)
            {
                character.RealName = processor.ProcessText(character.RealName, GameTextType.ItemDescription);
            }

            foreach (InventoryItem item in game.RootInventoryItemFolder.AllItemsFlat)
            {
                item.Description = processor.ProcessText(item.Description, GameTextType.ItemDescription);
            }

			for (int i = 0; i < game.GlobalMessages.Length; i++)
			{
				game.GlobalMessages[i] = processor.ProcessText(game.GlobalMessages[i], GameTextType.Message);
			}

            Factory.AGSEditor.RunProcessAllGameTextsEvent(processor, errors);
        }
开发者ID:Aquilon96,项目名称:ags,代码行数:59,代码来源:TextProcessingHelper.cs


示例12: SetRootViewFolder

 public static void SetRootViewFolder(Game game, IViewFolder folder)
 {
     ViewFolder default_folder = (ViewFolder)folder;
     if (default_folder != null)
     {
         game.RootViewFolder = default_folder;
     }
 }
开发者ID:Aquilon96,项目名称:ags,代码行数:8,代码来源:FolderHelper.cs


示例13: ProcessAllGameText

        public static void ProcessAllGameText(IGameTextProcessor processor, Game game, CompileMessages errors)
        {
            foreach (Dialog dialog in game.Dialogs)
            {
                foreach (DialogOption option in dialog.Options)
                {
                    option.Text = processor.ProcessText(option.Text, GameTextType.DialogOption, game.PlayerCharacter.ID);
                }

                dialog.Script = processor.ProcessText(dialog.Script, GameTextType.DialogScript);
            }

            foreach (Script script in game.Scripts)
            {
                if (!script.IsHeader)
                {
                    string newScript = processor.ProcessText(script.Text, GameTextType.Script);
                    if (newScript != script.Text)
                    {
                        // Only cause it to flag Modified if we changed it
                        script.Text = newScript;
                    }
                }
            }

            foreach (GUI gui in game.GUIs)
            {
                foreach (GUIControl control in gui.Controls)
                {
                    if (control is GUILabel)
                    {
                        ((GUILabel)control).Text = processor.ProcessText(((GUILabel)control).Text, GameTextType.ItemDescription);
                    }
                    else if (control is GUIButton)
                    {
                        ((GUIButton)control).Text = processor.ProcessText(((GUIButton)control).Text, GameTextType.ItemDescription);
                    }
                }
            }

            foreach (Character character in game.Characters)
            {
                character.RealName = processor.ProcessText(character.RealName, GameTextType.ItemDescription);
            }

            foreach (InventoryItem item in game.InventoryItems)
            {
                item.Description = processor.ProcessText(item.Description, GameTextType.ItemDescription);
            }

            for (int i = 0; i < game.GlobalMessages.Length; i++)
            {
                game.GlobalMessages[i] = processor.ProcessText(game.GlobalMessages[i], GameTextType.Message);
            }

            Factory.AGSEditor.RunProcessAllGameTextsEvent(processor, errors);
        }
开发者ID:smarinel,项目名称:ags-web,代码行数:57,代码来源:TextProcessingHelper.cs


示例14: ReplaceAllGameText

        public static CompileMessages ReplaceAllGameText(Game game, Translation withTranslation)
        {
            CompileMessages errors = new CompileMessages();

            TextImportProcessor processor = new TextImportProcessor(game, errors, withTranslation.TranslatedLines);

            TextProcessingHelper.ProcessAllGameText(processor, game, errors);

            return errors;
        }
开发者ID:Aquilon96,项目名称:ags,代码行数:10,代码来源:TextImporter.cs


示例15: CreateTranslationList

        public CompileMessages CreateTranslationList(Game game)
        {
            CompileMessages errors = new CompileMessages();

            TranslationSourceProcessor processor = new TranslationSourceProcessor(game, errors);

            TextProcessingHelper.ProcessAllGameText(processor, game, errors);

            _linesForTranslation = processor.LinesForTranslation;

            return errors;
        }
开发者ID:Aquilon96,项目名称:ags,代码行数:12,代码来源:TranslationGenerator.cs


示例16: CreateVoiceActingScript

		public CompileMessages CreateVoiceActingScript(Game game)
		{
			CompileMessages errors = new CompileMessages();

			VoiceActorScriptProcessor processor = new VoiceActorScriptProcessor(game, errors, GetFunctionCallsToProcessForSpeech(true));

			TextProcessingHelper.ProcessAllGameText(processor, game, errors);

			_linesByCharacter = processor.LinesByCharacter;
			_linesInOrder = processor.LinesInOrder;

			return errors;
		}
开发者ID:Aquilon96,项目名称:ags,代码行数:13,代码来源:VoiceActorScriptGenerator.cs


示例17: GlobalVariablesEditor

        public GlobalVariablesEditor(Game game)
        {
            InitializeComponent();
            lvwWords.ListViewItemSorter = new GlobalVariableComparer();
            _game = game;
            _variables = game.GlobalVariables;

            lvwWords.Sorting = SortOrder.Ascending;
            foreach (GlobalVariable variable in _variables.ToList())
            {
                lvwWords.Items.Add(CreateListItemFromVariable(variable));
            }
            lvwWords.Sort();
        }
开发者ID:smarinel,项目名称:ags-web,代码行数:14,代码来源:GlobalVariablesEditor.cs


示例18: InitializeEngine

        public void InitializeEngine(Game game, IntPtr editorHwnd)
        {
            _communicator.NewClient();
            _communicator.SendMessage("<Engine Command=\"START\" EditorWindow=\"" + editorHwnd + "\" />");
            ChangeDebugState(DebugState.Running);

            foreach (Script script in game.GetAllGameAndLoadedRoomScripts())
            {
                foreach (int line in script.BreakpointedLines)
                {
                    SetBreakpoint(script, line);
                }
            }

            _communicator.SendMessage("<Engine Command=\"READY\" EditorWindow=\"" + editorHwnd + "\" />");
        }
开发者ID:smarinel,项目名称:ags-web,代码行数:16,代码来源:DebugController.cs


示例19: SpeechLineProcessor

        public SpeechLineProcessor(Game game, bool includeNarrator, bool combineIdenticalLines, 
            bool removeNumbering, int? characterID,
            Dictionary<string, FunctionCallType> speechableFunctionCalls, 
            CompileMessages errors, StreamWriter referenceFile)
            : base(game, errors, true, false, speechableFunctionCalls)
        {
            _speechLineCount = new Dictionary<int, int>();
            _combineIdenticalLines = combineIdenticalLines;
            _includeNarrator = includeNarrator;
            _referenceFile = referenceFile;
            _removeNumbering = removeNumbering;
            _characterID = characterID;

            if (combineIdenticalLines)
            {
                _existingLines = new Dictionary<int, Dictionary<string, string>>();
            }
        }
开发者ID:smarinel,项目名称:ags-web,代码行数:18,代码来源:SpeechLineProcessor.cs


示例20: CreateInteractionScripts

 public static void CreateInteractionScripts(Game game, CompileMessages errors)
 {
     Script theScript = game.Scripts.GetScriptByFilename(Script.GLOBAL_SCRIPT_FILE_NAME);
     foreach (InventoryItem item in game.InventoryItems)
     {
         if (item.Name.Length < 1)
         {
             item.Name = "iInventory" + item.ID;
         }
         CreateScriptsForInteraction(item.Name, theScript, item.Interactions, errors);
     }
     foreach (Character character in game.Characters)
     {
         if (character.ScriptName.Length < 1)
         {
             character.ScriptName = "cCharacter" + character.ID;
         }
         CreateScriptsForInteraction(character.ScriptName, theScript, character.Interactions, errors);
     }
 }
开发者ID:sonneveld,项目名称:agscj,代码行数:20,代码来源:ImportExport.cs



注:本文中的AGS.Types.Game类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AIMLbot.Request类代码示例发布时间:2022-05-24
下一篇:
C# Types.ContentDocument类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap