Skip to content

Instantly share code, notes, and snippets.

@PoetaKodu
Created January 29, 2017 16:58
Show Gist options
  • Save PoetaKodu/25b436c993e61c0aa8e482fff21c549a to your computer and use it in GitHub Desktop.
Save PoetaKodu/25b436c993e61c0aa8e482fff21c549a to your computer and use it in GitHub Desktop.
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