Beispiel #1
0
 public FloorLayer(TabMap TabMap)
 {
     this.TabMap  = TabMap;
     LayerHeights = new int[] { 100 };
     Opacity.Add(100, 1);
     Redraw = true;
 }
Beispiel #2
0
        public Map(string JSONFileName)
        {
            dynamic mapInfo = Newtonsoft.Json.JsonConvert.DeserializeObject <dynamic>(File.ReadAllText(JSONFileName));

            Bounds = new Point((int)mapInfo.Width, (int)mapInfo.Height);
            Grid   = new MapTile[Bounds.X, Bounds.Y];
            Number = (int)mapInfo.Number;
            Name   = (string)mapInfo.Name;
            string lodMapName = $"lod{mapInfo.Number}.map";
            string directory  = Path.GetDirectoryName(JSONFileName);
            string lodMapPath = directory + "\\" + lodMapName;

            ReadFile(lodMapPath);
            TabMap = new TabMap(this);
            Floor  = new FloorLayer(TabMap);
            TabMap.Layers.Add(Floor);
            Grid.Action(
                (x, y, mapTile) =>
            {
                mapTile.OnMapLoaded();
                mapTile.Register();
                mapTile.RegisterLayers(Floor);
            }
                );
            PathFinder = new PathFinder(this);
            Loaded     = true;
        }
Beispiel #3
0
 public PathLayer(TabMap TabMap)
 {
     this.TabMap  = TabMap;
     LayerHeights = new int[] { 25, 50, 75, 125, 150 };
     Opacity.Add(25, 1f);
     Opacity.Add(50, 1f);
     Opacity.Add(75, 1f);
     Opacity.Add(125, 1f);
     Opacity.Add(150, 1f);
     Redraw = true;
     TabMap.Layers.Add(this);
 }