int main() { //define this to send output to a text file (see locations.h) #ifdef TEXTOUTPUT os.open("output.txt"); #endif //create a miner Miner Bob(ent_Miner_Bob); //create his wife MinersWife Elsa(ent_Elsa); Kitty Kitty(ent_cute_kitty); //run Bob and Elsa through a few Update calls for (int i=0; i<200; ++i) { // Bob.Update(); //Elsa.Update(); Kitty.Update(); Sleep(800); } //wait for a keypress before exiting PressAnyKeyToContinue(); return 0; }
void DisplayOutput (char* File, char* Rights, char* Trustee, int Errcode, FILE* Logfile) { if (stricmp (Trustee, "/f") == 0) printf ("%s\t%s\t%s", File, Rights, Trustee); else printf ("%s\t%s\t/NAME=%s", File, Rights, Trustee); if (Logfile) fprintf (Logfile, "%s %s %s", File, Rights, Trustee); switch (Errcode) { case SUCCESS: printf ("\n"); if (Logfile) fprintf (Logfile, "\n"); break; case ERR_FILE_INFO: printf (" - Error getting file information\n"); if (Logfile) fprintf (Logfile, " - Error getting file information\n"); break; case ERR_TRUSTEE_TO_NDS_OBJ: printf (" - Error mapping trustee to NDS object\n"); if (Logfile) fprintf (Logfile, " - Error mapping trustee to NDS object\n"); break; case ERR_NDS_OBJ_TO_TRUSTEE: printf (" - Error mapping NDS object to trustee\n"); if (Logfile) fprintf (Logfile, " - Error mapping NDS object to trustee\n"); break; case ERR_CANT_ASSIGN_RIGHTS: printf (" - Error assigning rights\n"); if (Logfile) fprintf (Logfile, " - Error assigning rights\n"); break; case ERR_CANT_SET_FILTER: printf (" - Error setting filter\n"); if (Logfile) fprintf (Logfile, " - Error setting filter\n"); break; } if (Pause != 0 && wherey () >= 22) { AwaitingInput = TRUE; PressAnyKeyToContinue (); AwaitingInput = FALSE; clrscr (); } }
int main() { //define this to send output to a text file (see locations.h) #ifdef TEXTOUTPUT os.open("output.txt"); #endif //seed random number generator srand((unsigned) time(NULL)); //create a miner Miner* Bob = new Miner(ent_Miner_Bob); //create his wife MinersWife* Elsa = new MinersWife(ent_Elsa); //create barfly BarFly* Henry = new BarFly(ent_Henry); //register them with the entity manager EntityMgr->RegisterEntity(Bob); EntityMgr->RegisterEntity(Elsa); EntityMgr->RegisterEntity(Henry); //run Bob and Elsa through a few Update calls for (int i=0; i<30; ++i) { Bob->Update(); Elsa->Update(); Henry->Update(); //dispatch any delayed messages Dispatch->DispatchDelayedMessages(); Sleep(800); } //tidy up delete Bob; delete Elsa; delete Henry; //wait for a keypress before exiting PressAnyKeyToContinue(); return 0; }