Example #1
0
 private static EscortSaveData GetEscortSaveData(IMyEntity escort, NpcGroupSaveData npcGroupSaveData)
 {
     foreach (var escortSaveData in npcGroupSaveData.Escorts)
     {
         if (escortSaveData.EscortEntityId == escort.EntityId)
         {
             return(escortSaveData);
         }
     }
     throw new ArgumentException("Can't find escort save data: " + escort.EntityId);
 }
Example #2
0
        internal NpcGroupSaveData GetSaveData()
        {
            var saveData = new NpcGroupSaveData
            {
                LeaderUnitType   = GetLeaderUnitType(),
                GroupId          = GroupLeaderId,
                Escorts          = GetEscortSaveData(),
                State            = GroupState,
                GroupDestination = Destination,
                NpcGroupType     = groupType,
                SpawnTime        = GroupSpawnTime.ToBinary()
            };

            return(saveData);
        }
Example #3
0
        internal void ReConnectEscort(IMyCubeGrid escort, NpcGroupSaveData npcGroupSaveData)
        {
            var escortSaveData = GetEscortSaveData(escort, npcGroupSaveData);

            escortDic.Add(escortSaveData.EscortPosition, escort);
        }