GetPickedCondition.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. ** Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  3. **
  4. ** File: GetPickedCondition.cpp
  5. **
  6. ** Author:
  7. **
  8. ** Description:
  9. ** Implementation of the training library "GetPickedCondition" interface.
  10. **
  11. ** History:
  12. */
  13. #include "pch.h"
  14. #include "GetPickedCondition.h"
  15. #include "TypeIDTarget.h"
  16. #include "console.h"
  17. namespace Training
  18. {
  19. //------------------------------------------------------------------------------
  20. // class methods
  21. //------------------------------------------------------------------------------
  22. /* void */ GetPickedCondition::GetPickedCondition (ObjectType targetType, ObjectID targetID) :
  23. m_pTarget (new TypeIDTarget (targetType, targetID))
  24. {
  25. }
  26. //------------------------------------------------------------------------------
  27. /* void */ GetPickedCondition::~GetPickedCondition (void)
  28. {
  29. delete m_pTarget;
  30. }
  31. //------------------------------------------------------------------------------
  32. bool GetPickedCondition::Evaluate (void)
  33. {
  34. return (GetWindow ()->GetConsoleImage ()->GetConsoleData ()->GetPickedObject () == static_cast<IbaseIGC*> (static_cast<ImodelIGC*> (*m_pTarget))) ? true : false;
  35. }
  36. //------------------------------------------------------------------------------
  37. }