コード例 #1
0
        //function to fill in the boxes showing the relations stats
        private void fillRelationBoxes(string withWhom, int otherLordNumber)
        {
            int  thisLordNumber = Variables.getTerritory(selectedTerritory).getLordNumber(); //lord number of the lord of the displayed territory
            Lord thisLord       = Variables.getLord(thisLordNumber);                         //the lord of the displayed territory
            Lord otherLord      = Variables.getLord(otherLordNumber);                        //the lord to compare the displayed lord with, based on the lord number passed to the function

            //the various stats to fill the boxes with
            int affinity;
            int theirOpinion;
            int opinionOfThem;
            int relationship;
            int theirStance;
            int stanceToThem;

            //holding variables for the boxes to be filled
            Label affinityBox;
            Label theirOpinionBox;
            Label opinionOfThemBox;
            Label relationshipBox;
            Label theirStanceBox;
            Label stanceToThemBox;

            //set stats
            affinity      = thisLord.getRelation(otherLordNumber, "affinity");
            theirOpinion  = thisLord.getRelation(otherLordNumber, "opinion");
            opinionOfThem = otherLord.getRelation(thisLordNumber, "opinion");
            relationship  = thisLord.getRelation(otherLordNumber, "relationship");
            theirStance   = thisLord.getRelation(otherLordNumber, "stance");
            stanceToThem  = otherLord.getRelation(thisLordNumber, "stance");

            //set which boxes are filled, based on value passed to function
            switch (withWhom)
            {
            case "other":

                affinityBox      = lblAffinityOther;
                theirOpinionBox  = lblOpinionOfOther;
                opinionOfThemBox = lblOtherOpinion;
                relationshipBox  = lblRelationshipOther;
                theirStanceBox   = lblStanceToOther;
                stanceToThemBox  = lblOtherStance;
                break;

            default:
                affinityBox      = lblAffinityYou;
                theirOpinionBox  = lblOpinionOfYou;
                opinionOfThemBox = lblYourOpinion;
                relationshipBox  = lblRelationshipYou;
                theirStanceBox   = lblStanceToYou;
                stanceToThemBox  = lblYourStance;
                break;
            }

            //fill boxes with stats
            affinityBox.Text      = affinity.ToString();
            theirOpinionBox.Text  = theirOpinion.ToString();
            opinionOfThemBox.Text = opinionOfThem.ToString();
            relationshipBox.Text  = relationship.ToString();
            theirStanceBox.Text   = theirStance.ToString();
            stanceToThemBox.Text  = stanceToThem.ToString();

            //change backcolor of boxes based on stat
            affinityBox.BackColor      = Variables.getColor(affinity, "affinity");
            theirOpinionBox.BackColor  = Variables.getColor(theirOpinion, "opinion");
            opinionOfThemBox.BackColor = Variables.getColor(opinionOfThem, "opinion");
            relationshipBox.BackColor  = Variables.getColor(relationship, "relationship");
            theirStanceBox.BackColor   = Variables.getColor(theirStance, "stance");
            stanceToThemBox.BackColor  = Variables.getColor(stanceToThem, "stance");
        } //end fillRelationBoxes()
コード例 #2
0
        public static void addLord(string nam, int ter, int hon, int pio, int gre, int adv, int lav)
        {
            Lord newLord = new Lord(nam, ter, hon, pio, gre, adv, lav);

            lordList.Add(newLord);
        }