You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

81 line
1.1 KiB

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the Do What The Fuck You Want To
  7. // Public License, Version 2, as published by Sam Hocevar. See
  8. // http://sam.zoy.org/projects/COPYING.WTFPL for more details.
  9. //
  10. #if defined HAVE_CONFIG_H
  11. # include "config.h"
  12. #endif
  13. #include <cstring>
  14. #include <cstdlib>
  15. #include <ctype.h>
  16. #include "core.h"
  17. namespace lol
  18. {
  19. /*
  20. * World implementation class
  21. */
  22. class WorldData
  23. {
  24. friend class World;
  25. private:
  26. int width, height;
  27. };
  28. /*
  29. * Public World class
  30. */
  31. World::World()
  32. : data(new WorldData())
  33. {
  34. data->width = 0;
  35. data->height = 0;
  36. m_drawgroup = DRAWGROUP_BEFORE;
  37. }
  38. World::~World()
  39. {
  40. delete data;
  41. }
  42. char const *World::GetName()
  43. {
  44. return "<world>";
  45. }
  46. void World::TickGame(float seconds)
  47. {
  48. Entity::TickGame(seconds);
  49. }
  50. void World::TickDraw(float seconds)
  51. {
  52. Entity::TickDraw(seconds);
  53. }
  54. int World::GetWidth()
  55. {
  56. return data->width * 32;
  57. }
  58. int World::GetHeight()
  59. {
  60. return data->height * 32;
  61. }
  62. } /* namespace lol */