Granary::Granary() { setType(B_GRANARY); setMaxWorkers(5); setWorkers(0); _size = 3; setPicture(PicLoader::instance().get_picture( ResourceGroup::commerce, 140)); _fgPictures.resize(6); // 1 upper level + 4 windows + animation int maxQty = 2400; _goodStore.setMaxQty(maxQty); _goodStore.setMaxQty(G_WHEAT, maxQty); _goodStore.setMaxQty(G_MEAT, maxQty); _goodStore.setMaxQty(G_FISH, maxQty); _goodStore.setMaxQty(G_FRUIT, maxQty); _goodStore.setMaxQty(G_VEGETABLE, maxQty); _goodStore.setCurrentQty(G_WHEAT, 300); _animation.load(ResourceGroup::commerce, 146, 7); // do the animation in reverse _animation.load(ResourceGroup::commerce, 151, 6); PicLoader& ldr = PicLoader::instance(); _fgPictures[0] = &ldr.get_picture( ResourceGroup::commerce, 141); _fgPictures[5] = _animation.getCurrentPicture(); computePictures(); }
MissionPost::MissionPost() { setType(B_MISSION_POST); _size = 2; setMaxWorkers(20); setWorkers(0); setPicture(PicLoader::instance().get_picture("transport", 93)); }
GovernorsVilla::GovernorsVilla() { setType(B_GOVERNOR_VILLA); _size = 4; setMaxWorkers(10); setWorkers(0); setPicture(PicLoader::instance().get_picture(rcHousingGroup, 47)); }
GovernorsHouse::GovernorsHouse() { setType(B_GOVERNOR_HOUSE); _size = 3; setMaxWorkers(5); setWorkers(0); setPicture(PicLoader::instance().get_picture(rcHousingGroup, 46)); }
Academy::Academy() { setType(B_MILITARY_ACADEMY); _size = 3; setMaxWorkers( 20 ); setWorkers( 0 ); setPicture(PicLoader::instance().get_picture( ResourceGroup::security, 18)); }
GovernorsPalace::GovernorsPalace() { setType(B_GOVERNOR_PALACE); _size = 5; setMaxWorkers(15); setWorkers(0); setPicture(PicLoader::instance().get_picture(rcHousingGroup, 48)); }
Barracks::Barracks() { setType(B_BARRACKS); _size = 3; setMaxWorkers(5); setWorkers(0); setPicture(PicLoader::instance().get_picture(ResourceGroup::security, 17)); }
ServiceBuilding::ServiceBuilding(const ServiceType &service) { _service = service; setMaxWorkers(5); setWorkers(0); _serviceTimer = 0; _serviceDelay = 80; _serviceRange = 30; }
ServiceBuilding::ServiceBuilding(const ServiceType service, const BuildingType type, const Size& size) : WorkingBuilding( type, size ), _d( new Impl ) { _service = service; setMaxWorkers(5); setWorkers(0); setServiceDelay( 80 ); _serviceTimer = 0; _serviceRange = 30; }
FactoryClay::FactoryClay() : Factory(G_NONE, G_CLAY, B_CLAY_PIT, Size(2) ) { _setProductRate( 9.6f ); _picture = &Picture::load( ResourceGroup::commerce, 61 ); _animation.load( ResourceGroup::commerce, 62, 10); _animation.setFrameDelay( 3 ); _fgPictures.resize(2); setMaxWorkers( 10 ); setWorkers( 0 ); }
Factory::Factory( const GoodType inType, const GoodType outType, const BuildingType type, const Size& size ) : WorkingBuilding( type, size ), _d( new Impl ) { setMaxWorkers(10); setWorkers(8); _d->productionRate = 4.8f; _d->progress = 0.0f; _inGoodType = inType; _outGoodType = outType; _goodStore.setMaxQty(1000); // quite unlimited _goodStore.setMaxQty(_inGoodType, 200); _goodStore.setMaxQty(_outGoodType, 200); }
Market::Market() : ServiceBuilding(S_MARKET, B_MARKET, Size(2) ), _d( new Impl ) { setMaxWorkers(5); setWorkers(5); setPicture( Picture::load( ResourceGroup::commerce, 1) ); _fgPictures.resize(1); // animation _d->goodStore.setMaxQty(5000); _d->goodStore.setMaxQty(G_WHEAT, 400); _d->goodStore.setMaxQty(G_POTTERY, 300); _d->goodStore.setCurrentQty(G_WHEAT, 200); _animation.load( ResourceGroup::commerce, 2, 10 ); _animation.setFrameDelay( 4 ); }
Market::Market() : ServiceBuilding(S_MARKET) { setType(B_MARKET); setMaxWorkers(5); setWorkers(0); _marketBuyer = NULL; _buyerDelay = 10; _size = 2; // _name = _("Marche"); setPicture(PicLoader::instance().get_picture("commerce", 1)); _fgPictures.resize(1); // animation _goodStore.setMaxQty(5000); _goodStore.setMaxQty(G_WHEAT, 400); _goodStore.setMaxQty(G_POTTERY, 300); _goodStore.setCurrentQty(G_WHEAT, 200); AnimLoader animLoader(PicLoader::instance()); animLoader.fill_animation(_animation, "commerce", 2, 10); }
Barracks::Barracks() : WorkingBuilding( B_BARRACKS, Size( 3 ) ) { setMaxWorkers(5); setWorkers(0); setPicture(PicLoader::instance().get_picture(ResourceGroup::security, 17)); }
MissionPost::MissionPost() : WorkingBuilding(B_MISSION_POST, Size(2) ) { setMaxWorkers(20); setWorkers(0); setPicture( Picture::load( ResourceGroup::transport, 93)); }
MissionPost::MissionPost() : WorkingBuilding(B_MISSION_POST, Size(2) ) { setMaxWorkers(20); setWorkers(0); setPicture(PicLoader::instance().get_picture("transport", 93)); }
GovernorsHouse::GovernorsHouse() : WorkingBuilding( B_GOVERNOR_HOUSE, Size(3) ) { setMaxWorkers(5); setWorkers(0); setPicture(Picture::load( ResourceGroup::housing, 46)); }
GovernorsVilla::GovernorsVilla() : WorkingBuilding(B_GOVERNOR_VILLA, Size(4) ) { setMaxWorkers(10); setWorkers(0); setPicture(Picture::load( ResourceGroup::housing, 47)); }
GovernorsPalace::GovernorsPalace() : WorkingBuilding(B_GOVERNOR_PALACE, Size( 5 ) ) { setMaxWorkers(15); setWorkers(0); setPicture(Picture::load(ResourceGroup::housing, 48)); }
Academy::Academy() : WorkingBuilding( B_MILITARY_ACADEMY, Size(3) ) { setMaxWorkers( 20 ); setWorkers( 0 ); setPicture(PicLoader::instance().get_picture( ResourceGroup::security, 18)); }
Barracks::Barracks() : WorkingBuilding( B_BARRACKS, Size( 3 ) ) { setMaxWorkers(5); setWorkers(0); setPicture( Picture::load( ResourceGroup::security, 17) ); }