TetrisDocument.cpp
上传用户:snevogroup
上传日期:2008-06-06
资源大小:432k
文件大小:1k
源码类别:

Symbian

开发平台:

C/C++

  1. #include "TetrisAppUi.h"
  2. #include "TetrisDocument.h"
  3. #include "CGameTetris.h"
  4. // Construct and Destruct
  5. // NewL()
  6. CTetrisDocument* CTetrisDocument::NewL(CEikApplication& aApp)
  7. {
  8. CTetrisDocument* self = NewLC(aApp);
  9. CleanupStack::Pop(self);
  10. return self;
  11. }
  12. // NewLC()
  13. CTetrisDocument* CTetrisDocument::NewLC(CEikApplication& aApp)
  14. {
  15. CTetrisDocument* self = new (ELeave) CTetrisDocument(aApp);
  16. CleanupStack::PushL(self);
  17. self->ConstructL();
  18. return self;
  19. }
  20. // ConstructL()
  21. void CTetrisDocument::ConstructL()
  22. {
  23. iGame = CGameTetris::NewL();
  24. }
  25. // CTetrisDocument()
  26. CTetrisDocument::CTetrisDocument(CEikApplication& aApp) : CAknDocument(aApp)
  27. {
  28. }
  29. // ~CTetrisDocument()
  30. CTetrisDocument::~CTetrisDocument()
  31. {
  32. delete iGame;
  33. }
  34. ///////////////////////////////////////////////////////////////
  35. // method
  36. // CreateAppUi()
  37. CEikAppUi* CTetrisDocument::CreateAppUiL()
  38. {
  39. CEikAppUi* appUi = new (ELeave) CTetrisAppUi(this);
  40.     return appUi;
  41. }
  42. CGameTetris* CTetrisDocument::Model()
  43. {
  44. return iGame;
  45. }