コード例 #1
0
 private static CompletedTransfer CompleteCraftTransfer(Base @base, TransferItem<Craft> transferredCraft)
 {
     @base.TransferredCrafts.Remove(transferredCraft);
     @base.Crafts.Add(transferredCraft.Item);
     var completedTransfer = new CompletedTransfer
     {
         Name = transferredCraft.Item.Name,
         Quantity = 1,
         Destination = @base.Name
     };
     return completedTransfer;
 }
コード例 #2
0
 private static CompletedTransfer CompleteStoreTransfer(Base @base, TransferItem<StoreItem> transferredStore)
 {
     @base.TransferredStores.Remove(transferredStore);
     switch (transferredStore.Item.ItemType)
     {
     case ItemType.Engineer:
         @base.EngineerCount += transferredStore.Item.Count;
         break;
     case ItemType.Scientist:
         @base.ScientistCount += transferredStore.Item.Count;
         break;
     default:
         @base.Stores.Add(transferredStore.Item.ItemType, transferredStore.Item.Count);
         break;
     }
     var completedTransfer = new CompletedTransfer
     {
         Name = transferredStore.Item.ItemType.Metadata().Name,
         Quantity = transferredStore.Item.Count,
         Destination = @base.Name
     };
     return completedTransfer;
 }
コード例 #3
0
 private static CompletedTransfer CompleteSoldierTransfer(Base @base, TransferItem<Soldier> transferredSoldier)
 {
     @base.TransferredSoldiers.Remove(transferredSoldier);
     @base.Soldiers.Add(transferredSoldier.Item);
     var completedTransfer = new CompletedTransfer
     {
         Name = transferredSoldier.Item.Name,
         Quantity = 1,
         Destination = @base.Name
     };
     return completedTransfer;
 }