예제 #1
0
		internal void SetMimanRunners(ProgramRunner pProgramRunner, SourceCodeDispenser pSourceCodeDispenser, DialogueRunner pDialogueRunner, WorldSettings pWorldSettings) 
        {
			_programRunner = pProgramRunner;
			_sourceCodeDispenser = pSourceCodeDispenser;
            _dialogueRunner = pDialogueRunner;
			_worldSettings = pWorldSettings;
		}
예제 #2
0
 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
		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
 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
 public void Init(ProgramRunner pProgramRunner)
 {
     _programRunner = pProgramRunner;
 }