gamelaserduckwindow.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. class idGameLaserDuckWindow;
  2. class LaserDuckEntity {
  3. public:
  4. const idMaterial * material;
  5. idStr materialName;
  6. float width, height;
  7. bool visible;
  8. idVec4 entColor;
  9. idVec2 position;
  10. float rotation;
  11. float rotationSpeed;
  12. idVec2 velocity;
  13. bool fadeIn;
  14. bool fadeOut;
  15. idGameLaserDuckWindow * game;
  16. public:
  17. LaserDuckEntity(idGameLaserDuckWindow* _game);
  18. virtual ~LaserDuckEntity();
  19. virtual void WriteToSaveGame( idFile *savefile );
  20. virtual void ReadFromSaveGame( idFile *savefile, idGameLaserDuckWindow* _game );
  21. void SetMaterial(const char* name);
  22. void SetSize( float _width, float _height );
  23. void SetVisible( bool isVisible );
  24. virtual void Update( float timeslice );
  25. virtual void Draw(idDeviceContext *dc);
  26. private:
  27. };
  28. class idGameLaserDuckWindow : public idWindow {
  29. public:
  30. idGameLaserDuckWindow(idUserInterfaceLocal *gui);
  31. idGameLaserDuckWindow(idDeviceContext *d, idUserInterfaceLocal *gui);
  32. ~idGameLaserDuckWindow();
  33. virtual void WriteToSaveGame( idFile *savefile );
  34. virtual void ReadFromSaveGame( idFile *savefile );
  35. virtual const char* HandleEvent(const sysEvent_t *event, bool *updateVisuals);
  36. virtual void PostParse();
  37. virtual void Draw(int time, float x, float y);
  38. virtual const char* Activate(bool activate);
  39. virtual idWinVar * GetWinVarByName (const char *_name, bool winLookup = false, drawWin_t** owner = NULL);
  40. private:
  41. void CommonInit();
  42. void ResetGameState();
  43. void UpdateButtons();
  44. void UpdateGame();
  45. virtual bool ParseInternalVar(const char *name, idParser *src);
  46. private:
  47. idWinBool gamerunning;
  48. idWinBool onNewGame;
  49. idList<LaserDuckEntity*> entities;
  50. LaserDuckEntity *duck;
  51. };