Exemplo n.º 1
0
 public void ReceiveCard(Card card)
 {
     if (card.Operator == StringResources.Lambda)
     {
         LambdaCards += 1;
     }
     else if (card.Operator == "p")
     {
         return;
     }
     else
     {
         /*IOperation<RealInt> _op = OperationFactory<RealInt>.Instance.GetOperation(card.Operator);
          * _op.Operate(Score, card.Point);*/
         if (card.Operator == StringResources.Plus)
         {
             Score = new RealInt(Score.Value + card.Point.Value);
         }
         if (card.Operator == StringResources.Minus)
         {
             Score = new RealInt(Score.Value - card.Point.Value);
         }
         if (card.Operator == StringResources.Multiply)
         {
             Score = new RealInt(Score.Value * card.Point.Value);
         }
         if (card.Operator == StringResources.Divide)
         {
             Score = new RealInt(Score.Value / card.Point.Value);
         }
     }
 }
Exemplo n.º 2
0
 public Card(int point, string _operator)
 {
     Point    = new RealInt(point);
     Operator = _operator;
 }
Exemplo n.º 3
0
 //public
 public void ResetPlayer(string name = "user", int score = 0, int lambdaCards = 0)
 {
     Name        = name;
     Score       = new RealInt(score);
     LambdaCards = lambdaCards;
 }