Class AiModel

All Implemented Interfaces:
IPlayerModel

public class AiModel extends GameObject implements IPlayerModel
AI Model class representing an AI player in the game. This class extends the GameObject class and implements the IPlayerModel interface.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AiModel(IMazeModel mazeModel)
    Constructor to initialize the AI model with the starting position based on the maze model.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the starting x-coordinate of the AI model.
    int
    Gets the starting y-coordinate of the AI model.
    void
    move(int dx, int dy)
    Moves the AI model by the specified delta values.
    void
    setPosition(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, setY

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.edu.xmum.CST210.Model.Interface.IPlayerModel

    getX, getY
  • Constructor Details

    • AiModel

      public AiModel(IMazeModel mazeModel)
      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:
      getStartX in interface IPlayerModel
      Returns:
      The starting x-coordinate.
    • getStartY

      public int getStartY()
      Gets the starting y-coordinate of the AI model.
      Specified by:
      getStartY in interface IPlayerModel
      Returns:
      The starting y-coordinate.
    • move

      public void move(int dx, int dy)
      Moves the AI model by the specified delta values.
      Specified by:
      move in interface IPlayerModel
      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:
      setPosition in interface IPlayerModel
      Parameters:
      x - The x-coordinate to set.
      y - The y-coordinate to set.