Ejemplo n.º 1
0
    def performAction(self, newPosition, maxRow, maxColumn):
        tempPos = PositionManager(self.position.x, self.position.y)
        position = Position.factory(newPosition)
        tempPos = position.update(tempPos)

        if tempPos.validatePosition(maxRow, maxColumn):
            return tempPos
        else:
            return False
Ejemplo n.º 2
0
class Player:
    view = Position.factory(Positioning.TOP)

    def __init__(self, xStart, yStart, id):
        self.position = PositionManager(xStart, yStart)
        self.id = id

    def performAction(self, newPosition, maxRow, maxColumn):
        tempPos = PositionManager(self.position.x, self.position.y)
        position = Position.factory(newPosition)
        tempPos = position.update(tempPos)

        if tempPos.validatePosition(maxRow, maxColumn):
            return tempPos
        else:
            return False