Example #1
0
        public MapEditor(string name)
        {
            Map map = Maps.Maps_[name];

            width_    = map.Width_;
            height_   = map.Height_;
            position_ = map.Initial_position_;
            cells_    = new CellEditor[width_, height_];
            for (int i = 0; i < width_; i++)
            {
                for (int j = 0; j < height_; j++)
                {
                    cells_[i, j] = new CellEditor(map.Map_[i, j].Content_);
                    cells_[i, j].Message_index_ = map.Map_[i, j].Message_index_;
                }
            }
            messages_ = new Dictionary <int, string>();
            foreach (var entry in map.Messages_)
            {
                messages_[entry.Key] = entry.Value;
            }
        }
Example #2
0
 public MapEditor(int width, int height)
 {
     messages_ = new Dictionary <int, string>();
     position_ = new Vector2(1);
     width_    = width;
     height_   = height;
     cells_    = new CellEditor[width, height];
     for (int i = 0; i < width; i++)
     {
         for (int j = 0; j < height; j++)
         {
             if (i == 0 || j == 0 || i == width - 1 || j == height - 1)
             {
                 int[] content = { 1, -1, -1 };
                 cells_[i, j] = new CellEditor(content);
             }
             else
             {
                 int[] content = { -1, -1, -1 };
                 cells_[i, j] = new CellEditor(content);
             }
         }
     }
 }