****This is an edited version of a previous post****

Hum de dum...no, really, I'm not an idiot. I just play one on TV after I 
haven't had enough sleep.

So I went ahead and finally grepped through the source code (WTF mate, why 
didn't you do that in the first place) and from what I can see the aim of the 
ruleset dev env is to assist in the process of developing the following code:


void MTSec::createBattleScoutHullComp() {
&nbsp; std&#58;&#58;map<unsigned int, std&#58;&#58;string> propertylist;
&nbsp; DesignStore *ds = 
Game&#58;&#58;getGame&#40;&#41;->getDesignStore&#40;&#41;;
&nbsp; Component* comp = new Component&#40;&#41;;
&nbsp; comp->setCategoryId&#40;1&#41;;
&nbsp; comp->setName&#40; "BattleScoutHull"&#41;;
&nbsp; comp->setDescription&#40; "The battle scout hull"&#41;;
&nbsp; comp->setTpclRequirementsFunction&#40;
&nbsp; &nbsp; "&#40;lambda &#40;design&#41; "
&nbsp; &nbsp; &nbsp; &nbsp; "&#40;if &#40;= &#40;designType.num-hulls 
design&#41; 1&#41; "
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "&#40;if &#40;< 
&#40;designType.num-baytypes design&#41; 2&#41; "
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "&#40;cons #t \"\"&#41; 
"
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "&#40;cons #f \"A ship 
can only have one type of missile bay\"&#41;&#41; "
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "&#40;cons #f \"A ship can only use 
one hull!\"&#41;&#41;&#41;"&#41;;
&nbsp; propertylist&#91;propertyIndex&#91;"Speed"&#93;&#93; = "&#40;lambda 
&#40;design&#41; &#40;* 75 1000000&#41;&#41;";
&nbsp; propertylist&#91;propertyIndex&#91;"BuildTime"&#93;&#93; = "&#40;lambda 
&#40;design&#41; 1&#41;";
&nbsp; propertylist&#91;propertyIndex&#91;"Colonise"&#93;&#93; = "&#40;lambda 
&#40;design&#41; 0&#41;";
&nbsp; propertylist&#91;propertyIndex&#91;"Armor"&#93;&#93; = "&#40;lambda 
&#40;design&#41; 5&#41;";
&nbsp; // To determine the total firepower of the ship, we multiply the
&nbsp; // firepower of an individual missile bay by how many missile bays
&nbsp; // the ship has.
&nbsp; // To determine how many missile bays the ship can have, we divide
&nbsp; // the ship size by the missile size.
&nbsp; propertylist&#91;propertyIndex&#91;"Firepower"&#93;&#93; = "&#40;lambda 
&#40;design&#41; "
&nbsp; &nbsp; &nbsp; &nbsp; "&#40;* &#40;floor &#40;/ 88 
&#40;designType.MissileSize design&#41;&#41;&#41; 
&#40;designType.MissileFirepower design&#41;&#41;&#41;";
&nbsp; propertylist&#91;propertyIndex&#91;"HitPoints"&#93;&#93; = "&#40;lambda 
&#40;design&#41; 100&#41;";
&nbsp; propertylist&#91;propertyIndex&#91;"num-ammo"&#93;&#93; = "&#40;lambda 
&#40;design&#41; 0&#41;";
&nbsp; propertylist&#91;propertyIndex&#91;"num-hulls"&#93;&#93; = "&#40;lambda 
&#40;design&#41; 1&#41;";
&nbsp; comp->setPropertyList&#40;propertylist&#41;;
&nbsp; ds->addComponent&#40;comp&#41;;

&nbsp; return;
&#125;


With a heavy focus being on making consistent, correct TPCL code, generating it 
if possible but most certainly making sure that it's TPCL code.

Many thanks, Lee, you sent me in the right direction.

-Fro





_______________________________________________
tp-devel mailing list
[email protected]
http://www.thousandparsec.net/tp/mailman.php/listinfo/tp-devel

Reply via email to