Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleanup old building classes

  • Loading branch information...
commit c5e62aedc1f5012f5baf7ae0ae991a074b162441 1 parent dd7a356
@nihathrael nihathrael authored
Showing with 25 additions and 124 deletions.
  1. +1 −1  content/objects/buildings/brickyard.yaml
  2. +1 −1  content/objects/buildings/butchery.yaml
  3. +1 −1  content/objects/buildings/charcoalburning.yaml
  4. +1 −1  content/objects/buildings/distillery.yaml
  5. +1 −1  content/objects/buildings/doctor.yaml
  6. +1 −1  content/objects/buildings/fireservice.yaml
  7. +1 −1  content/objects/buildings/hunterstent.yaml
  8. +1 −1  content/objects/buildings/lookout.yaml
  9. +1 −1  content/objects/buildings/lumberjackcamp.yaml
  10. +1 −1  content/objects/buildings/pavilion.yaml
  11. +1 −1  content/objects/buildings/rampart.yaml
  12. +1 −1  content/objects/buildings/saltponds.yaml
  13. +1 −1  content/objects/buildings/signalfire.yaml
  14. +1 −1  content/objects/buildings/smeltery.yaml
  15. +1 −1  content/objects/buildings/tavern.yaml
  16. +1 −1  content/objects/buildings/tobacconist.yaml
  17. +1 −1  content/objects/buildings/toolmaker.yaml
  18. +1 −1  content/objects/buildings/villageschool.yaml
  19. +1 −1  content/objects/buildings/weaverstent.yaml
  20. +0 −36 horizons/world/building/housing.py
  21. +0 −30 horizons/world/building/prevention.py
  22. +4 −37 horizons/world/building/production.py
  23. +2 −2 horizons/world/building/storages.py
View
2  content/objects/buildings/brickyard.yaml
@@ -1,6 +1,6 @@
id: 24
name: _ Brickyard
-baseclass: production.Refiner
+baseclass: production.ProductionBuilding
radius: 8
cost: 15
cost_inactive: 5
View
2  content/objects/buildings/butchery.yaml
@@ -1,6 +1,6 @@
id: 41
name: _ Butchery
-baseclass: production.Refiner
+baseclass: production.ProductionBuilding
radius: 8
cost: 15
cost_inactive: 5
View
2  content/objects/buildings/charcoalburning.yaml
@@ -1,6 +1,6 @@
id: 31
name: _ Charcoal Burning
-baseclass: production.CharcoalBurning
+baseclass: production.ProductionBuilding
radius: 6
cost: 10
cost_inactive: 0
View
2  content/objects/buildings/distillery.yaml
@@ -1,6 +1,6 @@
id: 26
name: _ Distillery
-baseclass: production.Refiner
+baseclass: production.ProductionBuilding
radius: 8
cost: 10
cost_inactive: 0
View
2  content/objects/buildings/doctor.yaml
@@ -1,6 +1,6 @@
id: 42
name: _ Doctor
-baseclass: prevention.Doctor
+baseclass: production.ProductionBuilding
radius: 10
cost: 20
cost_inactive: 5
View
2  content/objects/buildings/fireservice.yaml
@@ -1,6 +1,6 @@
id: 45
name: _ Fire Brigade
-baseclass: prevention.FireService
+baseclass: production.ProductionBuilding
radius: 13
cost: 15
cost_inactive: 5
View
2  content/objects/buildings/hunterstent.yaml
@@ -1,6 +1,6 @@
id: 9
name: _ Hunter's Tent
-baseclass: production.Hunter
+baseclass: production.ProductionBuilding
radius: 10
cost: 5
cost_inactive: 0
View
2  content/objects/buildings/lookout.yaml
@@ -1,6 +1,6 @@
id: 13
name: _ Lookout
-baseclass: housing.Housing
+baseclass: building.DefaultBuilding
radius: 10
cost: 0
cost_inactive: 0
View
2  content/objects/buildings/lumberjackcamp.yaml
@@ -9,7 +9,7 @@ id: 8
name:
0: _ Lumberjack Tent
1: _ Lumberjack Hut
-baseclass: production.Lumberjack
+baseclass: production.ProductionBuilding
radius: 3
cost: 5
cost_inactive: 0
View
2  content/objects/buildings/pavilion.yaml
@@ -1,6 +1,6 @@
id: 5
name: _ Pavilion
-baseclass: production.SettlerServiceProvider
+baseclass: production.ProductionBuilding
radius: 0
cost: 15
cost_inactive: 5
View
2  content/objects/buildings/rampart.yaml
@@ -1,6 +1,6 @@
id: 14
name: _ Rampart
-baseclass: housing.Housing
+baseclass: building.DefaultBuilding
radius: 10
cost: 0
cost_inactive: 0
View
2  content/objects/buildings/saltponds.yaml
@@ -1,6 +1,6 @@
id: 35
name: _ Salt Ponds
-baseclass: production.SaltPond
+baseclass: production.ProductionBuilding
radius: 0
cost: 10
cost_inactive: 0
View
2  content/objects/buildings/signalfire.yaml
@@ -1,6 +1,6 @@
id: 6
name: _ Signal Fire
-baseclass: housing.SignalFire
+baseclass: building.DefaultBuilding
radius: 10
cost: 0
cost_inactive: 0
View
2  content/objects/buildings/smeltery.yaml
@@ -1,6 +1,6 @@
id: 29
name: _ Smeltery
-baseclass: production.Smeltery
+baseclass: production.ProductionBuilding
radius: 10
cost: 50
cost_inactive: 15
View
2  content/objects/buildings/tavern.yaml
@@ -1,6 +1,6 @@
id: 32
name: _ Tavern
-baseclass: production.SettlerServiceProvider
+baseclass: production.ProductionBuilding
radius: 6
cost: 5
cost_inactive: 0
View
2  content/objects/buildings/tobacconist.yaml
@@ -1,6 +1,6 @@
id: 37
name: _ Tobacconist
-baseclass: production.Refiner
+baseclass: production.ProductionBuilding
radius: 8
cost: 10
cost_inactive: 0
View
2  content/objects/buildings/toolmaker.yaml
@@ -1,6 +1,6 @@
id: 30
name: _ Toolmaker
-baseclass: production.IronRefiner
+baseclass: production.ProductionBuilding
radius: 8
cost: 10
cost_inactive: 0
View
2  content/objects/buildings/villageschool.yaml
@@ -1,6 +1,6 @@
id: 21
name: _ Village school
-baseclass: production.SettlerServiceProvider
+baseclass: production.ProductionBuilding
radius: 0
cost: 15
cost_inactive: 5
View
2  content/objects/buildings/weaverstent.yaml
@@ -1,6 +1,6 @@
id: 7
name: _ Weaver's Tent
-baseclass: production.Refiner
+baseclass: production.ProductionBuilding
radius: 8
cost: 10
cost_inactive: 0
View
36 horizons/world/building/housing.py
@@ -1,36 +0,0 @@
-# ###################################################
-# Copyright (C) 2012 The Unknown Horizons Team
-# team@unknown-horizons.org
-# This file is part of Unknown Horizons.
-#
-# Unknown Horizons is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-# ###################################################
-
-from horizons.world.building.building import BasicBuilding
-from horizons.world.building.buildable import BuildableSingle
-
-class Housing(BasicBuilding, BuildableSingle):
-
- def save(self, db):
- super(Housing, self).save(db)
-
- def load(self, db, worldid):
- super(Housing, self).load(db, worldid)
-
-
-class SignalFire(Housing):
- range_applies_only_on_island = False
-
View
30 horizons/world/building/prevention.py
@@ -1,30 +0,0 @@
-# ###################################################
-# Copyright (C) 2012 The Unknown Horizons Team
-# team@unknown-horizons.org
-# This file is part of Unknown Horizons.
-#
-# Unknown Horizons is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-# ###################################################
-
-from horizons.world.building.buildingresourcehandler import BuildingResourceHandler
-from horizons.world.building.building import BasicBuilding
-from horizons.world.building.buildable import BuildableSingle
-
-class Doctor(BuildingResourceHandler, BuildableSingle, BasicBuilding):
- pass
-
-class FireService(BuildingResourceHandler, BuildableSingle, BasicBuilding):
- pass
View
41 horizons/world/building/production.py
@@ -29,13 +29,13 @@
from horizons.command.building import Build
from horizons.scheduler import Scheduler
from horizons.constants import BUILDINGS, PRODUCTION
-from horizons.gui.tabs import FarmProductionOverviewTab
-from horizons.world.status import InventoryFullStatus, ProductivityLowStatus
from horizons.world.production.producer import Producer
from horizons.world.component.storagecomponent import StorageComponent
-class Farm(BuildingResourceHandler, BuildableSingle, BasicBuilding):
- tabs = (FarmProductionOverviewTab,)
+class ProductionBuilding(BuildingResourceHandler, BuildableSingle, BasicBuilding):
+ pass
+
+class Farm(ProductionBuilding):
def _get_providers(self):
reach = RadiusRect(self.position, self.radius)
@@ -43,30 +43,6 @@ def _get_providers(self):
return [provider for provider in providers if isinstance(provider, Field)]
-class Lumberjack(BuildingResourceHandler, BuildableSingle, BasicBuilding):
- pass
-
-class Refiner(BuildingResourceHandler, BuildableSingle, BasicBuilding):
- pass
-
-class Hunter(BuildingResourceHandler, BuildableSingle, BasicBuilding):
- pass
-
-class IronRefiner(BuildingResourceHandler, BuildableSingle, BasicBuilding):
- pass
-
-class Smeltery(BuildingResourceHandler, BuildableSingle, BasicBuilding):
- pass
-
-class CharcoalBurning(BuildingResourceHandler, BuildableSingle, BasicBuilding):
- pass
-
-class SaltPond(BuildingResourceHandler, BuildableSingleOnCoast, BasicBuilding):
- pass
-
-class CannonBuilder(BuildingResourceHandler, BuildableSingle, BasicBuilding):
- pass
-
class Fisher(BuildingResourceHandler, BuildableSingleOnCoast, BasicBuilding):
"""
@@ -83,15 +59,6 @@ def get_non_paused_utilisation(self):
total += state_history[PRODUCTION.STATES.producing.index]
return total / float(len(productions))
-class SettlerServiceProvider(BuildingResourceHandler, BuildableSingle, BasicBuilding):
- """Class for Pavilion, School that provide a service-type res for settlers.
- Also provides collectors for buildings that consume resources (tavern)."""
- def get_status_icons(self):
- banned_classes = (InventoryFullStatus, ProductivityLowStatus)
- # inventories are full most of the time, don't show it
- return [ i for i in super(SettlerServiceProvider, self).get_status_icons() if \
- not i.__class__ in banned_classes ]
-
class Mine(BuildingResourceHandler, BuildableSingleOnDeposit, BasicBuilding):
def __init__(self, inventory, deposit_class, *args, **kwargs):
"""
View
4 horizons/world/building/storages.py
@@ -24,7 +24,7 @@
from building import BasicBuilding
from buildable import BuildableSingle, BuildableSingleFromShip
from horizons.world.component.storagecomponent import StorageComponent
-from horizons.world.building.production import SettlerServiceProvider
+from horizons.world.building.production import ProductionBuilding
from horizons.world.building.path import Path
from horizons.world.status import InventoryFullStatus
from horizons.world.component.collectingcompontent import CollectingComponent
@@ -80,7 +80,7 @@ def get_status_icons(self):
return [ i for i in super(Warehouse, self).get_status_icons() if \
not i.__class__ in banned_classes ]
-class MainSquare(Path, StorageBuilding, SettlerServiceProvider):
+class MainSquare(Path, StorageBuilding, ProductionBuilding):
walkable = True
def recalculate_orientation(self):
Please sign in to comment.
Something went wrong with that request. Please try again.