Example #1
0
        private void InitSm()
        {
            var sm = new HumanRelationshipStateMachine();

            sm.Logged += s => Log(s);
            var helloEvent     = sm.CreateEventLift(sm.Hello);
            var pissOffEvent   = sm.CreateEventLift(sm.PissOff);
            var introduceEvent = sm.CreateEventLift(sm.Introduce);

            helloButton.Click     += (s, e) => WithCurrentPerson(p => helloEvent.Raise(p));
            pissOffButton.Click   += (s, e) => WithCurrentPerson(p => pissOffEvent.Raise(p));
            introduceButton.Click += (s, e) => WithCurrentPerson(p => introduceEvent.Raise(p));
        }
 public PersonStateTranlator(HumanRelationshipStateMachine sm, Person person)
 {
     _sm     = sm;
     _person = person;
 }
Example #3
0
 public PersonSmInstance(HumanRelationshipStateMachine sm, Person data)
 {
     _sm  = sm;
     Data = data;
 }