Beispiel #1
0
        private void ConfigureMapTiles(MapModel mapModel, MapSerializationModel serializationModel)
        {
            foreach (var tileModel in serializationModel.TileList)
            {
                var mapTile = mapModel.GetTileModel(tileModel.Coords);

                foreach (var indicatorName in tileModel.IndicatorNames)
                {
                    var indicator = _indicatorProvider.GetIndicator(indicatorName, mapTile);
                    indicator.Position = mapTile.Position;
                    mapTile.Indicators.Add(indicator);
                }

                if (!string.IsNullOrWhiteSpace(tileModel.TowerName))
                {
                    var agentArgs = new CreateAgentArgs()
                    {
                        Tile = mapTile,
                        Team = tileModel.Team
                    };

                    var agent = _simulationManager.CreateAgent(tileModel.TowerName, agentArgs);
                    _simulationManager.Register(agent);
                    _simulationManager.Site(agent);
                }
            }
        }
Beispiel #2
0
        private void ConfigurePaths(MapModel mapModel, MapSerializationModel serializationModel)
        {
            foreach (var pathModel in serializationModel.Paths)
            {
                var mapPath = new MapPathModel();
                mapPath.Name = pathModel.PathName;

                foreach (var pathStep in pathModel.PathSteps)
                {
                    var mapTileModel = mapModel.GetTileModel(pathStep.Coords);
                    mapPath.Add(mapTileModel);
                }

                mapModel.AddPath(mapPath);
            }
        }