コード例 #1
0
ファイル: MimanTing.cs プロジェクト: KarmaLaBelle/GameWorld2
		internal void SetMimanRunners(ProgramRunner pProgramRunner, SourceCodeDispenser pSourceCodeDispenser, DialogueRunner pDialogueRunner, WorldSettings pWorldSettings) 
        {
			_programRunner = pProgramRunner;
			_sourceCodeDispenser = pSourceCodeDispenser;
            _dialogueRunner = pDialogueRunner;
			_worldSettings = pWorldSettings;
		}
コード例 #2
0
ファイル: MimanTing.cs プロジェクト: defc0n1/GameWorld2
 internal void SetMimanRunners(ProgramRunner pProgramRunner, SourceCodeDispenser pSourceCodeDispenser, DialogueRunner pDialogueRunner, WorldSettings pWorldSettings)
 {
     _programRunner       = pProgramRunner;
     _sourceCodeDispenser = pSourceCodeDispenser;
     _dialogueRunner      = pDialogueRunner;
     _worldSettings       = pWorldSettings;
 }
コード例 #3
0
 private void Init(RelayTwo pRelay)
 {
     paused              = false;
     isReadyToPlay       = false;
     relay               = pRelay;
     dialogueRunner      = new DialogueRunner(relay, Language.DEFAULT);
     roomRunner          = new RoomRunner(relay);
     programRunner       = new ProgramRunner(relay);
     sourceCodeDispenser = new SourceCodeDispenser(relay);
     timetableRunner     = new TimetableRunner(relay);
     settings            = new WorldSettings(relay);
     tingRunner          = new MimanTingRunner(relay, dialogueRunner, programRunner, sourceCodeDispenser, roomRunner, timetableRunner, settings);
     grimmApiDefinitions = new MimanGrimmApiDefinitions(this);
     grimmApiDefinitions.RegisterFunctions();
     grimmApiDefinitions.RegisterExpressions();
     translator = new Translator(Translator.Language.SWEDISH);
 }
コード例 #4
0
ファイル: World.cs プロジェクト: KarmaLaBelle/GameWorld2
		private void Init(RelayTwo pRelay)
        {
			paused = false;
			isReadyToPlay = false;
			relay = pRelay;
			dialogueRunner = new DialogueRunner(relay, Language.DEFAULT);
			roomRunner = new RoomRunner(relay);
			programRunner = new ProgramRunner(relay);
			sourceCodeDispenser = new SourceCodeDispenser(relay);
			timetableRunner = new TimetableRunner(relay);
			settings = new WorldSettings(relay);
            tingRunner = new MimanTingRunner(relay, dialogueRunner, programRunner, sourceCodeDispenser, roomRunner, timetableRunner, settings);
			grimmApiDefinitions = new MimanGrimmApiDefinitions(this);
			grimmApiDefinitions.RegisterFunctions();
			grimmApiDefinitions.RegisterExpressions();
			translator = new Translator (Translator.Language.SWEDISH);
		}
コード例 #5
0
        public MimanTingRunner(
            RelayTwo pRelay,
            DialogueRunner pDialogueRunner,
            ProgramRunner pProgramRunner,
            SourceCodeDispenser pSourceCodeDispenser,
            RoomRunner pRoomRunner,
            TimetableRunner pTimetableRunner,
            WorldSettings pWorldSettings
            )
            : base(pRelay, pRoomRunner)
        {
            _dialogueRunner = pDialogueRunner;
            _dialogueRunner.AddOnSomeoneSaidSomethingListener(this.OnSomeoneSaidSomething);
            _programRunner       = pProgramRunner;
            _sourceCodeDispenser = pSourceCodeDispenser;
            _timetableRunner     = pTimetableRunner;
            _worldSettings       = pWorldSettings;

            foreach (Ting ting in _tings.Values)
            {
                if (ting is MimanTing)
                {
                    (ting as MimanTing).SetMimanRunners(_programRunner, _sourceCodeDispenser, _dialogueRunner, _worldSettings);
                }
                if (ting is Character)
                {
                    (ting as Character).SetTimetableRunner(_timetableRunner);
                }
            }

            foreach (Ting ting in _tings.Values)
            {
                if (ting is MimanTing)
                {
                    var mimanTing = ting as MimanTing;
                    mimanTing.Init();
                    if (mimanTing.autoUnregisterFromUpdate && mimanTing.dialogueLine != "")
                    {
                        Unregister(mimanTing);
                    }
                }
            }
        }
コード例 #6
0
        public void SaveAndLoadAProgram()
        {
            const string saveName = "SaveAndLoadAProgramTest.json";
            const string programName = "PrintMagicNumber";
            const string sourceCode = "print(42)";

            int programObjectId;

            {
                Program p = _programRunner.CreateProgram(programName, sourceCode, "unknown");
                programObjectId = p.objectId;
                _relay.SaveAll(saveName);
            }

            {
                RelayTwo relay = new RelayTwo(saveName);
                ProgramRunner programRunner = new ProgramRunner(relay);
                Program p = programRunner.GetProgram(programObjectId);
                Assert.AreEqual(programName, p.name);
                Assert.AreEqual(sourceCode, p.sourceCodeContent);
            }
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: eriksvedang/GameWorld2
 public void Init(ProgramRunner pProgramRunner)
 {
     _programRunner = pProgramRunner;
 }
コード例 #8
0
 public void SetUp()
 {
     _relay = new RelayTwo();
     _relay.CreateTable(Program.TABLE_NAME);
     _programRunner = new ProgramRunner(_relay);
 }
コード例 #9
0
ファイル: Program.cs プロジェクト: defc0n1/GameWorld2
 public void Init(ProgramRunner pProgramRunner)
 {
     _programRunner = pProgramRunner;
 }