Created
January 29, 2017 16:58
-
-
Save PoetaKodu/25b436c993e61c0aa8e482fff21c549a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IPawnController | |
{ | |
public: | |
/* Konstruktor klasy kontrolera pionka */ | |
IPawnController(); | |
/* Destruktor klasy kontrolera pionka */ | |
virtual ~IPawnController(); | |
/* Funkcja będzie uaktualniała wszystko | |
co związane z ruchem pionka. Prezentacje pionka | |
zostawiamy dla jego klasy. | |
*/ | |
virtual void Update(const float &deltaTime) = 0; | |
/* Funkcja sprawdza czy kontroler jest używany | |
przez jakiegoś pionka. | |
*/ | |
inline bool IsPossessed() const { return m_owner != nullptr; } | |
/* Klasa pionka jest zobowiązana do ustawienia | |
siebie jako właściciela kontrolera (metodą Possess) | |
*/ | |
friend class IPawn; | |
private: | |
/* Ustawia właściciela tego kontrolera. | |
Kontroler można przypisać tylko jednorazowo. | |
Jeśli udało się przypisać kontroler do pionka to zwraca true. | |
*/ | |
bool Possess(IPawn *owner); | |
protected: | |
IPawn* m_owner; // Właściciel kontrolera. | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment