Eraser.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef ERASER_H
  2. #define ERASER_H
  3. /*************************************************************************************************\
  4. Eraser.h : Interface for the Eraser component.
  5. //---------------------------------------------------------------------------//
  6. // Copyright (C) Microsoft Corporation. All rights reserved. //
  7. //===========================================================================//
  8. \*************************************************************************************************/
  9. #ifndef BRUSH_H
  10. #include "Brush.h"
  11. #endif
  12. //*************************************************************************************************
  13. /**************************************************************************************************
  14. CLASS DESCRIPTION
  15. Eraser:
  16. **************************************************************************************************/
  17. #ifndef ELIST_H
  18. #include "EList.h"
  19. #endif
  20. #ifndef ACTION_H
  21. #include "Action.h"
  22. #endif
  23. #ifndef BUILDINGBRUSH_H
  24. #include "BuildingBrush.h"
  25. #endif
  26. #ifndef LINKBRUSH_H
  27. #include "LinkBrush.h"
  28. #endif
  29. #ifndef EDITORINTERFACE_H
  30. #include "EditorInterface.h" /*only for the definition of TeamsAction*/
  31. #endif
  32. class Eraser: public Brush
  33. {
  34. public:
  35. Eraser(){ pCurAction = NULL; }
  36. virtual bool beginPaint();
  37. virtual Action* endPaint();
  38. virtual bool paint( Stuff::Vector3D& worldPos, int screenX, int screenY );
  39. virtual bool canPaint( Stuff::Vector3D& worldPos, int screenX, int screenY, int flags );
  40. virtual Action* applyToSelection();
  41. private:
  42. class EraserAction : public ActionPaintTile
  43. {
  44. public:
  45. EraserAction() { teamsActionIsSet = false; }
  46. virtual bool undo();
  47. virtual bool redo();
  48. BuildingBrush::BuildingAction bldgAction;
  49. LinkBrush::LinkAction linkAction;
  50. /*deleting a building that is referred to by an objective condition requires a TeamAction
  51. to record the objective change*/
  52. bool teamsActionIsSet;
  53. TeamsAction teamsAction;
  54. };
  55. EraserAction* pCurAction;
  56. };
  57. //*************************************************************************************************
  58. #endif // end of file ( Eraser.h )