diff options
author | jonas <himself@jonasgunz.de> | 2018-12-10 17:54:50 +0100 |
---|---|---|
committer | jonas <himself@jonasgunz.de> | 2018-12-10 17:54:50 +0100 |
commit | 4e44cec4a2a29cfee132bbe1ee722fbc5168db87 (patch) | |
tree | df0e0b6b14763dd5d87338b98bbc257166345586 /AmpelJonas/cPeasant.cpp | |
parent | a87a70298aefdcade34739ae2aa3b07436aae328 (diff) | |
download | termgl-4e44cec4a2a29cfee132bbe1ee722fbc5168db87.tar.gz |
Removed program specific files, updated dependencies
Diffstat (limited to 'AmpelJonas/cPeasant.cpp')
-rw-r--r-- | AmpelJonas/cPeasant.cpp | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/AmpelJonas/cPeasant.cpp b/AmpelJonas/cPeasant.cpp deleted file mode 100644 index 280c16f..0000000 --- a/AmpelJonas/cPeasant.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "cPeasant.h" - -cPeasant::cPeasant(int _direction, int *_phase) -{ - pPhase = _phase; - iDirection = _direction; - pe = new cObject(1, 1); - pe->drawPoint(203, sPos{0,0}, true, _COL_YELLOW); - - switch (iDirection) - { - case _PE_DIR_NORTH: - pe->setPosition(_SIZE_X_ / 2 - 7, -1); - break; - case _PE_DIR_WEST: - pe->setPosition(-1, _SIZE_Y_ / 2 - 5); - break; - } -} - -cPeasant::~cPeasant() -{ - delete pe; -} - -cObject *cPeasant::getObject() -{ - return pe; -} - -void cPeasant::run() -{ - sPos oldPos = pe->getPosition(); - switch (iDirection) - { - case _PE_DIR_NORTH: - if(!(oldPos.y == _SIZE_Y_ / 2 - 5 && *pPhase != -1)) - pe->setPosition(oldPos.x, oldPos.y + 1); - - if(oldPos.y > _SIZE_Y_) - pe->setPosition(oldPos.x, -1); - break; - case _PE_DIR_WEST: - if (!(oldPos.x == _SIZE_X_ / 2 - 7 && *pPhase != 4)) - pe->setPosition(oldPos.x + 1, oldPos.y); - - if(oldPos.x > _SIZE_X_) - pe->setPosition(-1, oldPos.y); - break; - } -}
\ No newline at end of file |