Пример #1
0
        internal static void DoAction(PulseActionEnum action, Game game, SystemEntityJumpPair jumpPair)
        {
            _jumpPair = jumpPair;
            _game     = game;

            EnumProcessorMap[action].DynamicInvoke(game, jumpPair);
        }
Пример #2
0
        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);
        }
Пример #3
0
 internal static void JumpIn(Game game, SystemEntityJumpPair jumpPair)
 {
     jumpPair.JumpingEntity.Transfer(jumpPair.JumpSystem.SystemManager);
 }
Пример #4
0
 //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);
 }
Пример #5
0
 /// <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);
 }