예제 #1
0
 public ScreenLayerInfo(string name, TileLayer tiles, bool foreground, List<EntityPlacement> entities, List<ScreenLayerKeyframe> keyframes)
 {
     this.Name = name;
     this.Tiles = tiles;
     this.Foreground = foreground;
     this.Entities = entities;
     this.Keyframes = keyframes;
 }
예제 #2
0
        private ScreenLayerInfo LoadScreenLayer(XElement node, string stagePath, string name, Tileset tileset, int tileStartX, int tileStartY, bool foreground)
        {
            var tileFilePath = Path.Combine(stagePath, name + ".scn");

            var tileArray = LoadTiles(tileFilePath);
            var tileLayer = new TileLayer(tileArray, tileset, tileStartX, tileStartY);

            var entities = new List<EntityPlacement>();

            foreach (XElement entity in node.Elements("Entity"))
            {
                EntityPlacement info = LoadEntityPlacement(entity);
                entities.Add(info);
            }

            var keyframes = new List<ScreenLayerKeyframe>();
            foreach (var keyframeNode in node.Elements("Keyframe"))
            {
                var frame = LoadScreenLayerKeyFrame(keyframeNode);
                keyframes.Add(frame);
            }

            return new ScreenLayerInfo(name, tileLayer, foreground, entities, keyframes);
        }