BuildingBrush.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #ifndef BUILDINGBRUSH_H
  2. #define BUILDINGBRUSH_H
  3. /*************************************************************************************************\
  4. BuildingBrush.h : Interface for the BuildingBrush component. The thing you use to paint
  5. buildings
  6. //---------------------------------------------------------------------------//
  7. // Copyright (C) Microsoft Corporation. All rights reserved. //
  8. //===========================================================================//
  9. \*************************************************************************************************/
  10. #ifndef BRUSH_H
  11. #include "Brush.h"
  12. #endif
  13. #ifndef ACTION_H
  14. #include "Action.h"
  15. #endif
  16. #ifndef EDITOROBJECTMGR_H
  17. #include "EditorObjects.h"
  18. #endif
  19. //*************************************************************************************************
  20. /**************************************************************************************************
  21. CLASS DESCRIPTION
  22. BuildingBrush:
  23. **************************************************************************************************/
  24. class BuildingBrush: public Brush
  25. {
  26. public:
  27. BuildingBrush( int group, int indexInGroup, int Alignment );
  28. virtual ~BuildingBrush();
  29. virtual bool beginPaint();
  30. virtual Action* endPaint();
  31. virtual bool paint( Stuff::Vector3D& worldPos, int screenX, int screenY );
  32. virtual bool canPaint( Stuff::Vector3D& worldPos, int screenX, int screenY, int flags );
  33. virtual void render( int ScreenMouseX, int ScreenMouseY);
  34. virtual void update( int screenX, int screenY );
  35. void rotateBrush( int direction );
  36. class BuildingAction : public Action
  37. {
  38. public:
  39. virtual ~BuildingAction(){}
  40. virtual bool redo();
  41. virtual bool undo();
  42. virtual void addBuildingInfo(EditorObject& info);
  43. class OBJ_INFO_PTR_LIST : public EList<EditorObject *, EditorObject *> {
  44. public:
  45. ~OBJ_INFO_PTR_LIST() {
  46. EIterator it;
  47. for (it = Begin(); !it.IsDone(); it++) {
  48. delete (*it);
  49. }
  50. }
  51. };
  52. OBJ_INFO_PTR_LIST objInfoPtrList;
  53. };
  54. protected:
  55. // suppression
  56. BuildingBrush( const BuildingBrush& buildingBrush );
  57. BuildingBrush& operator=( const BuildingBrush& buildingBrush );
  58. BuildingBrush();
  59. int group;
  60. int indexInGroup;
  61. float curRotation;
  62. BuildingAction* pAction;
  63. ObjectAppearance* pCursor;
  64. int alignment;
  65. };
  66. //*************************************************************************************************
  67. #endif // end of file ( BuildingBrush.h )