Exemplo n.º 1
0
        public void Start()
        {
            if (bRunning == false)
            {
                // Backup all tokens data that can later be used to restore inital setting
                SaveTokensData();
                this.pnd.StepCounter = 0;

                if (pnd.pyCode.StartsWith("//C#"))
                {
                    script = new CSharpScript(pnd);
                }
                else
                {
                    script = new PythonScript(pnd);
                }

                script.InitScript();

                // Start simulation thread
                this.tdSimulate = new Thread(new ThreadStart(Simulate));
                tdSimulate.Start();

                this.bRunning = true;
            }
            else
            {
                this.tdSimulate.Resume();
            }
        }
Exemplo n.º 2
0
        public ScriptAction(IHostContext hostCtx, IScripter scripter, IScripterParser parser, IScripterConfigStorage configStorage)
        {
            if (hostCtx == null)
            {
                throw new ArgumentNullException("hostCtx");
            }
            if (scripter == null)
            {
                throw new ArgumentNullException("scripter");
            }
            if (parser == null)
            {
                throw new ArgumentNullException("parser");
            }

            _hostCtx       = hostCtx;
            _scripter      = scripter;
            _parser        = parser;
            _configStorage = configStorage;
        }
Exemplo n.º 3
0
    void Start()
    {
        dialogueSystem = new DialogueSystem()
        {
            Elements = new DialogueSystemElements()
            {
                DefaultSpeechSettings = new SpeechSettings()
                {
                    DisplaySpeed = 5f,
                    FontSettings = new FontSettings()
                    {
                        FontAsset    = ResourceHelpers.LoadFontAsset("OpenSans SDF"),
                        FontMaterial = ResourceHelpers.LoadMaterial("Fonts", "OpenSans SDF Presset")
                    },
                    FontColor         = Color.cyan,
                    FontSize          = 45,
                    FontOnSpeakerName = false
                },
                DialoguePanel      = DialogueSetup.Instance.DialoguePanel,
                SpeakerNameDisplay = DialogueSetup.Instance.SpeakerNameDisplay,
                SpeechTextDisplay  = DialogueSetup.Instance.SpeechTextDisplay
            }
        };
        GlobalSetup.Instance.DialogueSystem = dialogueSystem;

        characterManager = new CharacterManager()
        {
            CharacterPanel = CharacterSetup.Instance.CharacterPanelRect
        };
        character = (SingleLayerCharacter)characterManager.AddCharacter <SingleLayerCharacter>("Miu", true);
        character.Initialize(false);
        character.Renderer.SetSprite(GetSprite("neutral"));//Transition(ResourceHelpers.LoadCharacterSingleSprite("Miu"), 1f, false);
        character.Enabled = true;

        scripter = new Scripter();
        scripter.CommandFactory = new CommandFactory();
        scripter.Initialize(new ScriptText());
    }
Exemplo n.º 4
0
 public App(ISettings settings, ISqlServer sqlServer, IScripter scripter)
 {
     this.settings = settings;
     this.sqlServer = sqlServer;
     this.scripter = scripter;
 }