From e51f1c203897019ee5669e44d35cf1241514d442 Mon Sep 17 00:00:00 2001 From: masterm Date: Thu, 22 Feb 2007 23:04:02 +0000 Subject: ++++ fixed navigator logics --- source/Concept/Framework/modules/logic/logic.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'source/Concept/Framework/modules/logic/logic.h') diff --git a/source/Concept/Framework/modules/logic/logic.h b/source/Concept/Framework/modules/logic/logic.h index 296956b..ad8bad7 100755 --- a/source/Concept/Framework/modules/logic/logic.h +++ b/source/Concept/Framework/modules/logic/logic.h @@ -3,9 +3,6 @@ #include "../../stdafx.h" -#define STATUS_KEEPER_TURN_RIGHT 1 -#define STATUS_KEEPER_TURN_LEFT 2 - class Logic : public IO_Module { public: @@ -29,9 +26,18 @@ protected: bool isKeeper; uint8 status; + enum LogicalStatus + { + STATUS_KEEPER_TURN_RIGHT, + STATUS_KEEPER_TURN_LEFT, + }; + void OnBallOwned(); void OnBallLost(); + void OnBecomeKeeper(); + void OnBecomeAttacker(); + public: void Update(); @@ -46,6 +52,14 @@ public: } void SetKeeper(bool newStatus) { + if(!this->isKeeper && newStatus) + { + this->OnBecomeKeeper(); + } + else if(this->isKeeper && !newStatus) + { + this->OnBecomeAttacker(); + } this->isKeeper = newStatus; } -- cgit v1.2.3