src/proto2/GameState.cc
author terom
Mon, 10 Nov 2008 16:49:09 +0000
branchno-netsession
changeset 31 d0d7489d4e8b
parent 26 5685602aeb9c
child 35 e21cfda0edde
child 50 9e1a6506f5a1
permissions -rw-r--r--
add initial code written so far
26
5685602aeb9c it works \o/
terom
parents:
diff changeset
     1
5685602aeb9c it works \o/
terom
parents:
diff changeset
     2
#include "GameState.hh"
5685602aeb9c it works \o/
terom
parents:
diff changeset
     3
5685602aeb9c it works \o/
terom
parents:
diff changeset
     4
bool Player::updatePosition (Coordinate p) {
5685602aeb9c it works \o/
terom
parents:
diff changeset
     5
    if (!state.isValidCoordinate(p)) {
5685602aeb9c it works \o/
terom
parents:
diff changeset
     6
        // out-of-bounds
5685602aeb9c it works \o/
terom
parents:
diff changeset
     7
        return false;
5685602aeb9c it works \o/
terom
parents:
diff changeset
     8
5685602aeb9c it works \o/
terom
parents:
diff changeset
     9
    } else {
5685602aeb9c it works \o/
terom
parents:
diff changeset
    10
        // valid
5685602aeb9c it works \o/
terom
parents:
diff changeset
    11
        position = p;
5685602aeb9c it works \o/
terom
parents:
diff changeset
    12
5685602aeb9c it works \o/
terom
parents:
diff changeset
    13
        return true;
5685602aeb9c it works \o/
terom
parents:
diff changeset
    14
    }
5685602aeb9c it works \o/
terom
parents:
diff changeset
    15
}
5685602aeb9c it works \o/
terom
parents:
diff changeset
    16
5685602aeb9c it works \o/
terom
parents:
diff changeset
    17
5685602aeb9c it works \o/
terom
parents:
diff changeset
    18