DD/Supplying buildings with goods

From Unknown Horizons

Jump to: navigation, search
Image:Note.png

This page is part of the Unknown Horizons design document. Please discuss everything concerning this topic on the "discussion" tab of this page. If you´re not sure whether your ideas are fitting the Unknown Horizons style, either use the discussion page, talk to us, or edit the "Questions" section of this page, but please don´t directly edit the other parts.


Contents

Proposal

Summary

We have basically 2 kinds of buildings that need goods: settlers and production buildings. The latter ones additionally produce goods, which have to be collected.

For those two kinds, we have two kinds of storages, where collectors of those buildings can get their goods: market place and storage building.

The storage building extends the reach of the settlement, collects goods from producers and supplies produces with goods. The branch office is in this regard just a normal storage buildings.

The market place is only there to supply settlers, i.e. they can get food/textiles/etc. from the market place and only from there. (So this building is absolutely necessary as soon as you build 1 settler). The market place has no other special purpose, it does not extend the reach of the settlement

Implementation

  • The market place and the storage building inherit both from the storage building class.
  • To restrict settlers to the market place, we can subclass the buildingcollector class, and get_buildings_in_range() should only return market places.
  • We also need to make all other collectors ignore the market place. (see Open Questions)

Open questions

Question Open question:
[Implementation]: How do we make the collectors ignore the market place?

totycro

Answer Suggestion:
1. Let them be ignored in the normal get_buildings_in_range()-function.

2. Don't add them to the island.building_providers.
totycro

Personal tools
Unknown Horizons
Design Document