1 /* bzflag 2 * Copyright (c) 1993-2021 Tim Riker 3 * 4 * This package is free software; you can redistribute it and/or 5 * modify it under the terms of the license found in the file 6 * named COPYING that should have accompanied this file. 7 * 8 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 9 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 10 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 11 */ 12 13 #ifndef __WORLDBUILDER_H__ 14 #define __WORLDBUILDER_H__ 15 16 #include "common.h" 17 18 /* local interface headers */ 19 #include "World.h" 20 21 22 /** builds a bzlfag world 23 */ 24 class WorldBuilder 25 { 26 public: 27 WorldBuilder(); 28 ~WorldBuilder(); 29 30 const void* unpack(const void*); 31 const void* unpackGameSettings(const void*); 32 33 World* getWorld(); 34 World* peekWorld(); // doesn't give up ownership 35 36 void setGameType(short gameType); 37 void setGameOptions(short gameOptions); 38 void setMaxPlayers(int maxPlayers); 39 void setMaxShots(int maxSimultaneousShots); 40 void setMaxFlags(int maxFlags); 41 void setShakeTimeout(float timeout) const; 42 void setShakeWins(int wins) const; 43 void setBase(TeamColor team, 44 const float* pos, float rotation, 45 float w, float b, float h); 46 47 private: 48 void preGetWorld(); 49 50 private: 51 bool owned; 52 World* world; 53 }; 54 55 56 #endif /* __WORLDBUILDER_H__ */ 57 58 // Local Variables: *** 59 // mode: C++ *** 60 // tab-width: 4 *** 61 // c-basic-offset: 4 *** 62 // indent-tabs-mode: nil *** 63 // End: *** 64 // ex: shiftwidth=4 tabstop=4 65