/// <summary> /// Creates new a resource collection from a stack. /// </summary> public ResourceCollection(ResourceStack resStack) { this.SetResourceCount(resStack.Type, resStack.Count); }
/// <summary> /// Returns true if the player has at least the resouces contained in the stack. /// </summary> public bool HasAtLeast(ResourceStack stack) { return ResourceCards[stack.Type] >= stack.Count; }
/// <summary> /// Removes a number of resource cards of a certain type. Returns false if the player doesn't have enough. /// </summary> public bool RemoveResources(ResourceStack stack) { return RemoveResources(stack.Type, stack.Count); }
/// <summary> /// Creates a new trade offer. /// </summary> public TradeOffer(int playerId, ResourceStack toGive, ResourceStack toReceive) { this.CreatorPlayerId = playerId; this.ToGive = new ResourceCollection(toGive); this.ToReceive = new ResourceCollection(toReceive); }