示例#1
0
 /// <summary>
 /// Creates new a resource collection from a stack.
 /// </summary>
 public ResourceCollection(ResourceStack resStack)
 {
     this.SetResourceCount(resStack.Type, resStack.Count);
 }
示例#2
0
文件: Player.cs 项目: jsnklpn/jatan
 /// <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
文件: Player.cs 项目: jsnklpn/jatan
 /// <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);
 }