All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pacman.game.internal.PacMan Maven / Gradle / Ivy

There is a newer version: 2.0.1.0
Show newest version
package pacman.game.internal;

import pacman.game.Constants.MOVE;

/*
 * Data structure to hold all information pertaining to Ms Pac-Man.
 */
public final class PacMan {
    public int currentNodeIndex, numberOfLivesRemaining;
    public MOVE lastMoveMade;
    public boolean hasReceivedExtraLife;

    public PacMan(int currentNodeIndex, MOVE lastMoveMade, int numberOfLivesRemaining, boolean hasReceivedExtraLife) {
        this.currentNodeIndex = currentNodeIndex;
        this.lastMoveMade = lastMoveMade;
        this.numberOfLivesRemaining = numberOfLivesRemaining;
        this.hasReceivedExtraLife = hasReceivedExtraLife;
    }

    public PacMan copy() {
        return new PacMan(currentNodeIndex, lastMoveMade, numberOfLivesRemaining, hasReceivedExtraLife);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy