Esempio n. 1
0
		public ResourceContainer ReceiveLootStrike(BaseUnit attacker)
		{
			var takenLoot = new ResourceContainer();

			Log.Steb("Getting a lootstrike " + _buildInstructions.unitName);

			foreach (ResourceType lootType in Enum.GetValues(typeof(ResourceType)))
			{
				var takenAmount = resourceContainer.Subtract(lootType, 30d);

				Log.Steb("Took " + takenAmount + " of type " + lootType.ToString());

				takenLoot.Add(lootType, takenAmount);
			}

			return takenLoot;
		}
Esempio n. 2
0
		public static ResourceContainer operator -(ResourceContainer a, ResourceContainer b)
		{
			var newContainer = new ResourceContainer();

			for (var i = 0; i < a.resourceList.Count; i++)
			{
				newContainer.Add(a.resourceList[i].type, a.resourceList[i].amount);
			}

			for (var i = 0; i < b.resourceList.Count; i++)
			{
				newContainer.Subtract(b.resourceList[i].type, b.resourceList[i].amount);
			}

			return newContainer;
		}