Ejemplo n.º 1
0
        public CityManager(City city, bool viewCity = false) : base(MouseCursor.Pointer)
        {
            _viewCity = viewCity;
            OnResize += Resize;

            _city = city;

            Palette = Common.DefaultPalette;
            this.Clear(5);

            _subScreens.Add(_cityHeader      = new CityHeader(_city));
            _subScreens.Add(_cityResources   = new CityResources(_city));
            _subScreens.Add(_cityUnits       = new CityUnits(_city));
            _subScreens.Add(_cityMap         = new CityMap(_city));
            _subScreens.Add(_cityBuildings   = new CityBuildings(_city));
            _subScreens.Add(_cityFoodStorage = new CityFoodStorage(_city));
            _subScreens.Add(_cityInfo        = new CityInfo(_city));
            _subScreens.Add(_cityProduction  = new CityProduction(_city, viewCity));

            _cityBuildings.BuildingUpdate += BuildingUpdate;
            _cityHeader.HeaderUpdate      += HeaderUpdate;
            _cityMap.MapUpdate            += MapUpdate;

            if (Width != 320 || Height != 200)
            {
                Resize(null, new ResizeEventArgs(Width, Height));
            }
        }
Ejemplo n.º 2
0
        public CityManager(City city)
        {
            _city       = city;
            _background = Resources.Instance.GetPart("SP299", 288, 120, 32, 16);
            Picture.ReplaceColours(_background, new byte[] { 7, 22 }, new byte[] { 57, 9 });

            Cursor = MouseCursor.Pointer;

            _canvas = new Picture(320, 200, Common.GamePlay.Palette);
            _canvas.FillRectangle(5, 0, 0, 320, 200);

            _subScreens.Add(_cityHeader      = new CityHeader(_city, _background));
            _subScreens.Add(_cityResources   = new CityResources(_city, _background));
            _subScreens.Add(_cityUnits       = new CityUnits(_city, _background));
            _subScreens.Add(_cityMap         = new CityMap(_city, _background));
            _subScreens.Add(_cityBuildings   = new CityBuildings(_city, _background));
            _subScreens.Add(_cityFoodStorage = new CityFoodStorage(_city, _background));
            _subScreens.Add(_cityInfo        = new CityInfo(_city, _background));
            _subScreens.Add(_cityProduction  = new CityProduction(_city, _background));

            _cityBuildings.BuildingUpdate += BuildingUpdate;
            _cityHeader.HeaderUpdate      += HeaderUpdate;
            _cityMap.MapUpdate            += MapUpdate;
        }