Example #1
0
 public Terrain(int id, string missionname)
 {
     Id = id;
         Name = missionname;
         gameflags = new GameFlag[15];
         HasValue = false;
         HasCount = false;
         gameflags[0] = new GameFlag(0, "gfBorder", false);
         gameflags[1] = new GameFlag(1, "gfSolidLand", false);
         gameflags[2] = new GameFlag(1, "gfForts", false);
         gameflags[3] = new GameFlag(1, "gfInfAttack", false);
         gameflags[4] = new GameFlag(1, "gfInvulnerable", false);
         gameflags[5] = new GameFlag(1, "gfVampiric", false);
         gameflags[6] = new GameFlag(1, "gfSolidLand", false);
         gameflags[7] = new GameFlag(1, "gfSolidLand", false);
         gameflags[8] = new GameFlag(1, "gfSolidLand", false);
         gameflags[9] = new GameFlag(1, "gfSolidLand", false);
         gameflags[10] = new GameFlag(1, "gfSolidLand", false);
 }
Example #2
0
        public int CountGameFlag(GameFlag[] gameflags)
        {
            HasCount = true;
                 gameflagcount = 0;
                 gameflagdif = 0;
                 Valuestring = "";
                 Flagstring = "";

                  for (int i = 0; i <= gameflags.Count() - 1; i++)
                     if (gameflags[i] != null && gameflags[i].Value == true)
                         {
                         gameflagcount += 1;
                         Valuestring = Valuestring + gameflags[i].Name + "+";
                         }

               if (Valuestring != "")
                 Flagstring = Valuestring.Substring(0, Valuestring.Length - 1);
                 gameflagdif = gameflagcount - 1;
                 return gameflagcount;
        }