public MainWindow() { _formConstructed = false; InitializeComponent(); _db = new DbInterface(); _tiles = new TileConfigInterface(); _drawingHandler = new DrawingHandler("Main", this, _tiles, _db); _painter = new Painter(this, _db); _fogOfWarPainter = new FogOfWarPainter(this, _db); _timeAndWeatherHandler = new TimeAndWeatherHandler(_db); imgHexMap.BackColor = ColorTranslator.FromHtml("#333333"); cmbTerrain.Items.AddRange(_tiles.GetTerrainNames()); cmbTerrain.SelectedIndex = 1; cmbVegetation.Items.AddRange(_tiles.GetVegetationNames()); cmbVegetation.SelectedIndex = 0; cmbIcon.Items.AddRange(_tiles.GetIconNames()); cmbIcon.SelectedIndex = 0; cmbPlayerIcon.Items.AddRange(_tiles.GetIconNames()); cmbPlayerIcon.SelectedIndex = 0; object[] riverSizes = { "Stream", "River, Small", "River, Large" }; cmbRiver.Items.AddRange(riverSizes); cmbRiver.SelectedIndex = 0; object[] roadSizes = { "Trail", "Dirt Road", "Cobbled Road", "Ancient Road" }; cmbRoad.Items.AddRange(roadSizes); cmbRoad.SelectedIndex = 0; object[] fogOfWarTypes = { "Full", "Half" }; cmbFogOfWar.Items.AddRange(fogOfWarTypes); cmbFogOfWar.SelectedIndex = 0; rbSelect.Checked = true; chk100GmIcons.Checked = true; chk100PlayerIcons.Checked = true; _formConstructed = true; imgHexMap.SetPosition(_db.Session.Get().CurrentMapCorner); DrawMap(); _autoSaveTimer = new Timer(e => AutoSave(), null, TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1)); }
public PlayerWindow(TileConfigInterface tiles, DbInterface db, TimeAndWeatherHandler timeAndWeatherHandler) { InitializeComponent(); _drawingHandler = new DrawingHandler("Player", this, tiles, db); _fogOfWarPainter = new FogOfWarPainter(this, db); _timeAndWeatherHandler = timeAndWeatherHandler; _timeAndWeatherHandler.Subscribe(this); imgPlayerMap.BackColor = ColorTranslator.FromHtml("#333333"); imgPlayerMap.SetPosition(db.Session.Get().CurrentMapCorner); DrawMap(); UpdateTimeAndWeather(); }
public DrawingHandler(string tag, IDrawingUi drawingUi, TileConfigInterface tiles, DbInterface db) { _handlerTag = tag; _drawingUi = drawingUi; _terrainLayerDrawer = new TerrainLayerDrawer(drawingUi, tiles, db); _riverLayerDrawer = new RiverLayerDrawer(drawingUi, tiles, db); _roadLayerDrawer = new RoadLayerDrawer(drawingUi, tiles, db); _gmIconLayerDrawer = new GmIconLayerDrawer(drawingUi, tiles, db); _playerIconLayerDrawer = new PlayerIconLayerDrawer(drawingUi, tiles, db); _fogOfWarLayerDrawer = new FogOfWarLayerDrawer(drawingUi, tiles, db); _selectLayerDrawer = new SelectLayerDrawer(drawingUi, tiles, db); _partyLayerDrawer = new PartyLayerDrawer(drawingUi, db); _overlayGridLayerDrawer = new OverlayGridLayerDrawer(drawingUi); _layerDrawers = new List <BaseLayerDrawer> { _terrainLayerDrawer, _riverLayerDrawer, _roadLayerDrawer, _gmIconLayerDrawer, _playerIconLayerDrawer, _fogOfWarLayerDrawer }; }
public RoadLayerDrawer(IDrawingUi uiInterface, TileConfigInterface tiles, DbInterface db) : base(uiInterface, tiles, db) { }
public TerrainLayerDrawer(IDrawingUi uiInterface, TileConfigInterface tiles, DbInterface db) : base(uiInterface, tiles, db) { _mapTileImages = new Dictionary <string, Bitmap>(); }
protected BaseLayerDrawer(IDrawingUi uiInterface, TileConfigInterface tiles, DbInterface db) { UiInterface = uiInterface; Tiles = tiles; Db = db; }