示例#1
0
        void CheckRequirement(string[] args)
        {
            if (args.Length <= 1)
            {
                error("'check' requires a type argument.");
            }

            if (!Enum.TryParse <CommodityType>(args[1], ignoreCase: true, out CommodityType type))
            {
                error("Can't interpret {0} as a CommodityType.", args[1]);
            }

            RequirementVO req = new RequirementVO()
            {
                Type = type
            };

            if (args.Length > 2)
            {
                if (!int.TryParse(args[2], out req.Value))
                {
                    req.ID = args[2];
                }
            }
            if (args.Length > 3)
            {
                if (!int.TryParse(args[3], out req.Value))
                {
                    req.ID = args[3];
                }
            }

            log(AmbitionApp.CheckRequirement(req)
                ? "passed with default operator"
                : "failed with default operator");
        }
示例#2
0
        // Checks the Paris model for known locations or currently available explorable locations
        public static bool Check(RequirementVO req)
        {
            ParisModel paris = AmbitionApp.Paris;

            return((paris.Exploration.Contains(req.ID) || paris.Rendezvous.Contains(req.ID)) == (req.Value > 0));
        }
示例#3
0
 public static bool Check(RequirementVO req) => AmbitionApp.Inventory.Inventory.Exists(i => i.ID == req.ID);
示例#4
0
        // Checks both the "equipped" servant titles and the names of the servants employed
        public static bool Check(RequirementVO req)
        {
            ServantVO servant = AmbitionApp.GetModel <ServantModel>().GetServant(req.ID);

            return(RequirementsSvc.Check(req, (int)(servant?.Status ?? ServantStatus.Unknown)));
        }