Esempio n. 1
0
 public IEnumerator <YieldInstruction> LandedOnTile(Character character)
 {
     DungeonScene.EventEnqueueFunction <SingleCharEvent> function = (StablePriorityQueue <GameEventPriority, EventQueueElement <SingleCharEvent> > queue, Priority maxPriority, ref Priority nextPriority) =>
     {
         TileData entry = DataManager.Instance.GetTile(ID);
         AddEventsToQueue <SingleCharEvent>(queue, maxPriority, ref nextPriority, entry.LandedOnTiles, character);
     };
     foreach (EventQueueElement <SingleCharEvent> effect in DungeonScene.IterateEvents <SingleCharEvent>(function))
     {
         yield return(CoroutineManager.Instance.StartCoroutine(effect.Event.Apply(effect.Owner, effect.OwnerChar, character)));
     }
 }
Esempio n. 2
0
 public IEnumerator <YieldInstruction> InteractWithTile(Character character)
 {
     DungeonScene.EventEnqueueFunction <SingleCharEvent> function = (StablePriorityQueue <GameEventPriority, Tuple <GameEventOwner, Character, SingleCharEvent> > queue, Priority maxPriority, ref Priority nextPriority) =>
     {
         TileData entry = DataManager.Instance.GetTile(ID);
         AddEventsToQueue <SingleCharEvent>(queue, maxPriority, ref nextPriority, entry.InteractWithTiles);
     };
     foreach (Tuple <GameEventOwner, Character, SingleCharEvent> effect in DungeonScene.IterateEvents <SingleCharEvent>(function))
     {
         yield return(CoroutineManager.Instance.StartCoroutine(effect.Item3.Apply(effect.Item1, effect.Item2, character)));
     }
 }