Exemple #1
0
 public Game(List<Character> fullList, outputFunction outputFunction, cleverOutput cleverOutputFunction, Rules rules)
 {
     this.fullList = fullList;
     this.characterQueue = initiateQueue();
     this.Output = outputFunction;
     this.cleverOutput = cleverOutputFunction;
     this.rules = rules;
 }
Exemple #2
0
        private void loadRules_btn_Click(object sender, EventArgs e)
        {
            OpenFileDialog Dlg = new OpenFileDialog();
              Dlg.Filter = "Rule Set DLL|*.dll";
              Dlg.InitialDirectory = Directory.GetCurrentDirectory();
              DialogResult DlgResult = Dlg.ShowDialog();
              if (DlgResult == System.Windows.Forms.DialogResult.OK)
              {
            string loadString = "";
            loadString += "Rules | Loading " + Dlg.FileName;
            Rules tempRules = Loader.LoadRuleset(Dlg.FileName);
            if (tempRules != null)
            {
              rules = tempRules;
              loadString += "\n  Turn Points: " + rules.AllowedTurnPoints;
              loadString += "\n  Scale: " + rules.Scale;
              loadString += "\nSuccessfully loaded rules.";
            }
            else
              loadString += "\nError loading rules, rules not found.";

            this.sendMessageToLog(loadString);

              }
        }
Exemple #3
0
        private Tuple<bool, string> IsCharacterOk(Rules rules, List<Character> characterList)
        {
            foreach (Character c in characterList)
            {
                Tuple<bool, string> cCheck = rules.IsCharacterIllegal(c);
                if (cCheck.Item1)
                    return new Tuple<bool, string>(false, cCheck.Item2);

            }

            return new Tuple<bool, string>(true, "All is ok.");
        }
Exemple #4
0
        private Tuple<bool, string> IsAbilityOk(Rules rules, List<Character> characterList)
        {
            foreach (Character c in characterList)
            {
                Tuple<bool, Ability> aCheck = rules.IsAbilityIlligal(c);
                if (aCheck.Item1)
                    return new Tuple<bool, string>(false, "The character " + c.CharBase.Name + "'s ability " + aCheck.Item2.Name + " is illegal. The cost allowed by the game is " + (rules.Scale * rules.BaseCost).ToString() + " but the ability cost was " + (aCheck.Item2.Cost * rules.Scale).ToString() + ".");
            }

            return new Tuple<bool, string>(true, "All Ok");
        }