internal void SetMimanRunners(ProgramRunner pProgramRunner, SourceCodeDispenser pSourceCodeDispenser, DialogueRunner pDialogueRunner, WorldSettings pWorldSettings) { _programRunner = pProgramRunner; _sourceCodeDispenser = pSourceCodeDispenser; _dialogueRunner = pDialogueRunner; _worldSettings = pWorldSettings; }
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); }
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); }
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); } } } }
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); } }
public void Init(ProgramRunner pProgramRunner) { _programRunner = pProgramRunner; }
public void SetUp() { _relay = new RelayTwo(); _relay.CreateTable(Program.TABLE_NAME); _programRunner = new ProgramRunner(_relay); }