# ECS - Components inside components?

Reading up on ECS, I've tried to implement a simple 'game', if you can call it that. Basic concepts :

You have planets(entity), they produce gold. (gold is a component inside planet)
Planets can build buildings on themselves(Buildings component)
A building(entity) has associated gold costs(Costs component)

But costs component has Gold in it(or it needs to anyway)

As to my question :
Am I close with my interpretation of ECS(Should components be inside other components?)
Are resources a valid Component? if not, where would it make sense to place them?

Edit for clarity :

ECS - Entity-Component-System.
My entities are empty hash tables of components.
My components are used inside systems for game logic, the Treasury entity has a Gold component and the IncomeSystem updates that component.

Other components (Buildable, Population, Moveable)

• When dealing with ECS, it's better to describe what E, C and S mean to you and your implementation, since there is no standard in what an ECS is. – Alexandre Vaillancourt May 1 '17 at 10:52
• @AlexandreVaillancourt - Edited for clarity, I hope it helps! – Patrick May 1 '17 at 10:55

• The Universe entity has many Planet child-entities
• A Planet entity has many Building child-entities
I am not sure if it makes sense to make Gold a full-fledged component. Is it really more than just a number? Does "gold" have any behavior or interaction with components of other entities? If not I would rather expect it to be a simple variable in the BuildCost-component, the ResourceProducer-component and the Treasury - component.