예제 #1
0
 public static void SetState <M, F, S>(this ISmcTask <M, F, S> inst, S value)
     where M : class, IStored <M>, new()
     where F : statemap.FSMContext
     where S : statemap.State
 {
     inst.Fsm.GetType().GetProperty("State").SetValue(inst, value);
 }
예제 #2
0
 /// <summary>
 /// Must explicitly be called after deserialization.
 /// </summary>
 public static void SetOwner <M, F, S>(this ISmcTask <M, F, S> inst)
     where M : class, IStored <M>, new()
     where F : statemap.FSMContext
     where S : statemap.State
 {
     inst.Fsm.GetType().GetProperty("Owner").SetValue(inst.Fsm, inst);
 }
예제 #3
0
 public static S GetState <M, F, S>(this ISmcTask <M, F, S> inst)
     where M : class, IStored <M>, new()
     where F : statemap.FSMContext
     where S : statemap.State
 {
     return((S)inst.Fsm.GetType().GetProperty("State").GetValue(inst.Fsm));
 }