void TextElite::GetMarketInfo(unsigned int uiPlanetIndex, std::vector<MarketInfo>& vecMarketInfos) { ATLASSERT(uiPlanetIndex < galsize); const markettype& market = uiPlanetIndex == GetCurrentPlanet() ? localmarket : genmarket(0x00,galaxy[uiPlanetIndex]); for(unsigned int ui=0; ui<lasttrade+1; ui++) { vecMarketInfos.push_back(MarketInfo(market.quantity[ui], market.price[ui])); } }
/**+main **/ int main() { uint i; char getcommand[maxlen]; nativerand=1; printf("\nWelcome to Text Elite 1.4.\n"); for(i=0;i<=lasttrade;i++) strcpy(tradnames[i],commodities[i].name); mysrand(12345);/* Ensure repeatability */ galaxynum=1; buildgalaxy(galaxynum); currentplanet=numforLave; /* Don't use jump */ localmarket = genmarket(0x00,galaxy[numforLave]);/* Since want seed=0 */ fuel=maxfuel; #define PARSER(S) { char buf[0x10];strcpy(buf,S);parser(buf);} PARSER("hold 20"); /* Small cargo bay */ PARSER("cash +100"); /* 100 CR */ PARSER("help"); #undef PARSER for(;;) { printf("\n\nCash :%.1f>",((float)cash)/10); gets(getcommand); parser(getcommand); } /* 6502 Elite fires up at Lave with fluctuation=00 and these prices tally with the NES ones. However, the availabilities reside in the saved game data. Availabilities are calculated (and fluctuation randomised) on hyperspacing I have checked with this code for Zaonce with fluctaution &AB against the SuperVision 6502 code and both prices and availabilities tally. */ return(0); }
void gamejump(planetnum i) /* Move to system i */ { currentplanet=i; localmarket = genmarket(randbyte(),galaxy[i]); }