Пример #1
0
 /// <summary>
 /// Adjusts the size of the map.  If there is already a map created, clears the old map and
 /// initializes a new one.  None of the data from the old map is preserved.
 /// </summary>
 /// <param name="offset"></param>
 private void AdjustSize(int offset)
 {
     resolution += offset;
     resolution = (int)MathHelper.Clamp(resolution, 1, 11);
     size = (int)Math.Pow(2, resolution) + 1;
     if (map != null)
         map.Destroy();
     map = new Map(size, size);
     map.AddColorMap(Map.DefaultColorMap);
 }