Example #1
0
 /// <summary>
 /// Creates a entity group that aims to travel from the start chunk to the end chunk
 /// </summary>
 /// <param name="startChunk"></param>
 /// <param name="endChunk"></param>
 /// <param name="entities"></param>
 public EntityGroup(Vec2i startChunk, List <Entity> entities = null, EconomicInventory inventory = null)
 {
     ShouldDestroy     = false;
     StartChunk        = startChunk;
     CurrentPosition   = startChunk.AsVector2();
     GroupEntityIDs    = new List <int>();
     GroupInventory    = new Inventory();
     EconomicInventory = inventory == null?new EconomicInventory(): inventory;
     if (entities != null)
     {
         foreach (Entity e in entities)
         {
             GroupEntityIDs.Add(e.ID);
             GroupInventory.AddAll(e.Inventory);
             CombatStrength += e.CombatManager.CalculateEntityCombatStrength();
         }
     }
 }