コード例 #1
0
 private static void fillLineWith(Case[] line, Case sample)
 {
     for (int i = 0; i < line.Length; i++)
     {
         line[i] = new Case(sample.color, sample.thereIsAStar, sample.thereIsARobo);
     }
 }
コード例 #2
0
 private static Boolean isValidCoordinate(int x, int y, Case[][] map)
 {
     if (x >= 0 && x < map.Length)
         if (y >= 0 && y < map[0].Length)
             return true;
     return false;
 }
コード例 #3
0
        public Boolean resize(int heigth, int length)
        {
            Case sample = new Case(Color.BLACK, false, false);

            try
            {
                this.map = new Case[heigth][];
                for (int i = 0; i < heigth; i++)
                {
                    this.map[i] = new Case[length];
                    fillLineWith(this.map[i], sample);
                }
            }
            catch (Exception e)
            {
                return false;
            }
            return true;
        }