Ejemplo n.º 1
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);
 }
Ejemplo n.º 2
0
        public void Update(float dt, GameTime pCurrentTime, Character pCharacter, MimanTingRunner pTingRunner, RoomRunner pRoomRunner, DialogueRunner pDialogueRunner, WorldSettings pWorldSettings)
        {
            TimetableSpan currentSpan = GetCurrentSpan(pCurrentTime);

            if (currentSpan != TimetableSpan.NULL)
            {
                if (pCharacter.isAvatar)
                {
                    return;
                }

                if (pCharacter.lastTimetableSpan != currentSpan)
                {
                    if (pCharacter.lastTimetableSpan != TimetableSpan.NULL)
                    {
                        pCharacter.logger.Log(pCharacter.name + " ended span " + pCharacter.lastTimetableSpan.name);
                        pCharacter.lastTimetableSpan.behaviour.OnFinish(pCharacter, pTingRunner, pRoomRunner, pDialogueRunner);
                    }
                    else
                    {
                        pCharacter.logger.Log(pCharacter.name + " ended span NULL");
                    }
                }
                pCharacter.lastTimetableSpan = currentSpan;

                //pCharacter.logger.Log("Current timetable span to update: " + currentSpan.ToString());
                if (pCharacter.timetableTimer <= 0f)
                {
                    pCharacter.timetableTimer = currentSpan.behaviour.Execute(pCharacter, pTingRunner, pRoomRunner, pDialogueRunner, pWorldSettings);
                    //pCharacter.logger.Log(pCharacter.name + " executed " + currentSpan.behaviour + " and set timetableTimer to " + pCharacter.timetableTimer);
                }
                else
                {
                    pCharacter.timetableTimer -= dt;
                    //pCharacter.logger.Log(pCharacter.name + " timetableTimer = " + pCharacter.timetableTimer);
                }
            }
            else
            {
                D.Log("Found no matching time span in Timetable for character " + pCharacter.name + " at time " + pCurrentTime);
            }
        }