Пример #1
0
 /// <summary>
 /// Creates new a resource collection from a stack.
 /// </summary>
 public ResourceCollection(ResourceStack resStack)
 {
     this.SetResourceCount(resStack.Type, resStack.Count);
 }
Пример #2
0
 /// <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;
 }
Пример #3
0
 /// <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);
 }
Пример #4
0
 /// <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);
 }