Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3303 closed enhancement (fixed)

[PATCH] Tweak ResourceTrickle Schema

Reported by: s0600204 Owned by: s0600204
Priority: Should Have Milestone: Alpha 19
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

In JS Components where collectable resources are expressed in rates, the XML Schema is typically

// ResourceGatherer.js
<Rates>
	<food.fish>1</food.fish>
	<metal.ore>3</metal.ore>
	<stone.rock>3</stone.rock>
	<wood.tree>2</wood.tree>
</Rates>

// Cost.js
<Resources>
	<food>50</food>
	<wood>0</wood>
	<stone>0</stone>
	<metal>25</metal>
</Resources>

The exception to this is ResourceTrickle:

	<FoodRate>1.0</FoodRate>
	<WoodRate>1.0</WoodRate>
	<StoneRate>0.75</StoneRate>
	<MetalRate>0.75</MetalRate>

The provided patch, adapted from the resource-agnostic mod on GitHub, modifies the XML Schema of the ResourceTrickle Component and all of the entity templates that use it, so as to match the schemas of the other components.

Attachments (1)

trickle.diff (3.7 KB ) - added by s0600204 9 years ago.
Proposed patch

Download all attachments as: .zip

Change History (4)

by s0600204, 9 years ago

Attachment: trickle.diff added

Proposed patch

comment:1 by Itms, 9 years ago

Looks good! You can leave the schema indentation as it was though, because it is easier to read and modify. Thanks for the patch :)

comment:2 by leper, 9 years ago

Resolution: fixed
Status: newclosed

In 16783:

Change ResourceTrickle schema to match all other resource schemas. Patch by s0600204. Fixes #3303.

comment:3 by leper, 9 years ago

Keywords: review removed

Thanks for the patch. It needed an interleave as otherwise there were validation failures. I also made GetRates() use a loop instead of too much hard-coding.

Note: See TracTickets for help on using tickets.