예제 #1
0
 public Facility(FacilityType t)
 {
     type        = t;
     name        = t.ToString(); //TODO
     status      = Status.Ok;
     assignedBot = null;
 }
예제 #2
0
    public JSONObject jsonify()
    {
        JSONObject json = new JSONObject(JSONObject.Type.OBJECT);

        json.AddField("level", level);
        json.AddField("type", type.ToString());
        json.AddField("exercise", exercise.jsonify());

        return(json);
    }
예제 #3
0
        public void Selected_NoSelected_ErrorMessageWithCorrectFacility(FacilityType type)
        {
            var model = new ManageAatfsViewModel()
            {
                FacilityType = type
            };

            ValidationContext validationContext = new ValidationContext(model, null, null);

            IList <ValidationResult> result = model.Validate(validationContext).ToList();

            Assert.True(result.Count() > 0);
            Assert.Equal(string.Format("You must select an {0} to manage", type.ToString().ToUpper()), result[0].ErrorMessage);
        }
예제 #4
0
        public void BuyFacility(FacilityType desiredType)
        {
            // TODO
            int cost = Prices.facilPrices[desiredType];

            bool success = SpendMoney(cost);

            if (success)
            {
                Facility newFac = new Facility(desiredType);
                facilities.Add(newFac);
            }
            System.Console.WriteLine(
                PurchaseResult(desiredType.ToString().ToLower(), success, cost));
        }