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