****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. But, this format also looks nice. And what I'm thinking is developing, then, a program that knows about Properties and Components and Designs and can create them all and cross reference them and the like. The information being kept in an implementation independent fashion until the code is actually generated (say, XML). Then there could be an abstract generator interface that can be implemented for specific servers (C++ server output being implemented in the first place)...hm...more digging through the code, then. 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
