adityaravishankar/command-and-conquer — Issue #40: use a database for unit & building parameters.
Author: jovoud
Created: 2012-01-27 16:36:58+00:00
State: open

Shouldn't it be easier to create a unitManager and buildingManager object that create the units and buildings using db files?
In the sourcecode you have lot of this:
[code]
'tiberium-silo':{
name:'tiberium-silo',
label:'Tiberium Silo',
powerIn:10,
cost:150,
sight:2,
hitPoints:150,
imagesToLoad:[
{name:'build',count:20},{name:"healthy",count:5},
{name:"damaged",count:5},{name:"ultra-damaged",count:1}],
gridShape: [[1,1]]
},
'hand-of-nod':{
name:'hand-of-nod',
label:'Hand of Nod',
powerIn:20,
cost:300,
sight:3,
hitPoints:400,
imagesToLoad:[
{name:'build',count:20},{name:"healthy",count:1},
{name:"damaged",count:1},{name:"ultra-damaged",count:1}],
gridShape: [[0,0],
[1,1],
[1,1]]
},
[/code]
It's not that hard to create a manager which builds these object using xml files or some other kind of file or db.
Makes it easier to add units and change values + if people later on want to create mods based on this game, it's much easier.