internal static void DoAction(PulseActionEnum action, Game game, SystemEntityJumpPair jumpPair) { _jumpPair = jumpPair; _game = game; EnumProcessorMap[action].DynamicInvoke(game, jumpPair); }
public static void SetJump(Game game, DateTime exitTime, StarSystem entrySystem, DateTime entryTime, Entity jumpingEntity) { SystemEntityJumpPair jumpPair = new SystemEntityJumpPair { JumpSystem = entrySystem, JumpingEntity = jumpingEntity }; game.GameLoop.AddSystemInteractionInterupt(exitTime, PulseActionEnum.JumpOutProcessor, jumpPair); game.GameLoop.AddSystemInteractionInterupt(entryTime, PulseActionEnum.JumpInProcessor, jumpPair); }
internal static void JumpIn(Game game, SystemEntityJumpPair jumpPair) { jumpPair.JumpingEntity.Transfer(jumpPair.JumpSystem.SystemManager); }
//TODO look at turning the entity into a ProtoEntity instead of shifting it to the GlobalManager internal static void JumpOut(Game game, SystemEntityJumpPair jumpPair) { jumpPair.JumpingEntity.Transfer(game.GlobalManager); }
/// <summary> /// Adds an interupt where systems are interacting (ie an entity jumping between systems) /// this forces all systems to synch at this datetime. /// </summary> /// <param name="datetime"></param> /// <param name="action"></param> /// <param name="jumpPair"></param> internal void AddSystemInteractionInterupt(DateTime datetime, PulseActionEnum action, SystemEntityJumpPair jumpPair) { if (!EntityDictionary.ContainsKey(datetime)) { EntityDictionary.Add(datetime, new Dictionary <PulseActionEnum, List <SystemEntityJumpPair> >()); } if (!EntityDictionary[datetime].ContainsKey(action)) { EntityDictionary[datetime].Add(action, new List <SystemEntityJumpPair>()); } EntityDictionary[datetime][action].Add(jumpPair); }