public void PlayerPickResource(RobotPlayerPart player) { if (!HasResource) { return; } var item = Factory.CreateItem(); player.Pickup(item); HasResource = false; NextResourceGeneration = simulationEngine.CurrentTime + GenerationInterval; }
public void PerformTrade(RobotPlayerPart player) { if (!CanTradeWith(player)) { return; } var ret = player.TakeItems(WantsType, WantsAmount); foreach (var i in ret) { ItemFactory.Destroy(i); } for (int i = 0; i < GivesAmount; i++) { player.Pickup(ItemFactory.CreateItem(GivesType)); } StoredResourcesCount -= GivesAmount; }