Package com.edu.xmum.CST210.Model.Entity
Class AiModel
java.lang.Object
com.edu.xmum.CST210.Model.AbstractClass.GameObject
com.edu.xmum.CST210.Model.Entity.AiModel
- All Implemented Interfaces:
IPlayerModel
AI Model class representing an AI player in the game.
This class extends the GameObject class and implements the IPlayerModel interface.
-
Constructor Summary
ConstructorsConstructorDescriptionAiModel(IMazeModel mazeModel) Constructor to initialize the AI model with the starting position based on the maze model. -
Method Summary
Modifier and TypeMethodDescriptionintGets the starting x-coordinate of the AI model.intGets the starting y-coordinate of the AI model.voidmove(int dx, int dy) Moves the AI model by the specified delta values.voidsetPosition(int x, int y) Sets the position of the AI model to the specified coordinates.Methods inherited from class com.edu.xmum.CST210.Model.AbstractClass.GameObject
getX, getY, setX, setYMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.edu.xmum.CST210.Model.Interface.IPlayerModel
getX, getY
-
Constructor Details
-
AiModel
Constructor to initialize the AI model with the starting position based on the maze model.- Parameters:
mazeModel- The maze model containing the maze structure and start position.
-
-
Method Details
-
getStartX
public int getStartX()Gets the starting x-coordinate of the AI model.- Specified by:
getStartXin interfaceIPlayerModel- Returns:
- The starting x-coordinate.
-
getStartY
public int getStartY()Gets the starting y-coordinate of the AI model.- Specified by:
getStartYin interfaceIPlayerModel- Returns:
- The starting y-coordinate.
-
move
public void move(int dx, int dy) Moves the AI model by the specified delta values.- Specified by:
movein interfaceIPlayerModel- Parameters:
dx- The delta x value.dy- The delta y value.
-
setPosition
public void setPosition(int x, int y) Sets the position of the AI model to the specified coordinates.- Specified by:
setPositionin interfaceIPlayerModel- Parameters:
x- The x-coordinate to set.y- The y-coordinate to set.
-