On Thu, 05 Jun 2008, Ryan Neufeld wrote: > I had a quick question about tpserver-cpp and rulesets. Is it possible > for me to get a reference to the main ruleset class currently being > used.
> Is getting a reference to the currently running ruleset impossible? It's possible: Game::getGame()->getRuleset() > Reason being I have some data I need access outside of Risk.cpp, > in RiskTurn.cpp and in my Move's, and the data is not easily storable > as an IGObject. > Could I store the data in another more accessible class, say RiskTurn > (which I believe you can get access too via TurnManager), or do I need > to create IGObjects to store the data out in the field? If the data can be recreated somehow, then you can store it in Risk or RiskTurn (or whereever), but if it can't be (some hidding info about the state of the game, for example) then it should be stored in an IGObject that is not visible to the players, so it can be placed in the database and retrieved when needed. > I appreciate our help, > > Ryan 'jphr' Neufeld > --------------------------- > visit me at hammerofcode.com > > p.s. I may be answering my own question a bit here, but just to let > you know, the data I am storing is fairly turn and order specific; The > data consists of the following: > > - std::map<uint32_t,uint32_t> reinforcements -> Used to update > player's objects (to display reinforcements) and to restrain how many > units a player can deploy as reinforcements. If this is only filled and used in the turn processing, then it doesn't need to be persisted. > - UGraph graph -> indicates connectivity between planets, used to > restrict movement orders to adjacent destinations. I believe you are going to set this up either by hand or by file, so it doesn't need to be persisted. I think we might also need to thing about how we are going to indicate the connections between end points (such as wormholes and link gates). A new ObjectParameter type? Later Lee
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ tp-devel mailing list [email protected] http://www.thousandparsec.net/tp/mailman.php/listinfo/tp-devel
