Esempio n. 1
0
 public ParametrizedCharacter <TCharacter> AddCollideInteraction <T>(Action <TCharacter, T> action)
     where T : ParametrizedGameObject
 {
     if (!conditionalEvents.ContainsKey(typeof(T)))
     {
         conditionalEvents[typeof(T)] = new List <ConditionalEventWrapper>();
     }
     conditionalEvents[typeof(T)].Add(ConditionalEventWrapper.CreateWrapper(
                                          new SimpleCollideInteraction <TCharacter, T>((a, b) =>
     {
         if (a != b)
         {
             action(a, b);
         }
     })));
     return(this);
 }
 public static ConditionalEventWrapper Wrap <TObject1, TObject2>(this IConditionalEvent <TObject1, TObject2> item)
     where TObject1 : GameObject
     where TObject2 : GameObject
 {
     return(ConditionalEventWrapper.CreateWrapper(item));
 }
Esempio n. 3
0
 public void AddIConditionalEvent <TFirst, TSecond>(IConditionalEvent <TFirst, TSecond> action)
     where TFirst : GameObject
     where TSecond : GameObject
 {
     AddToDictionary(typeof(TFirst), typeof(TSecond), ConditionalEventWrapper.CreateWrapper(action));
 }