Skip to content

This project applies some of the OOP and data Structure concepts I learned. I made a simple AI that can play 1 on 1 basketball using methods from the random class, I added attributes to modify the players actions to simulate a real 1v1 basketball game

Notifications You must be signed in to change notification settings

y4nder/BasketBall-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Main

Summary

The Main class is responsible for managing a list of basketball players and providing methods to create, modify, and remove players from the list.

Example Usage

PlayerList playerList = new PlayerList();

// Create a new player with a specified name
playerList.createPlayer("Jordan");

// Modify the attributes of a player
playerList.playerEditor(1);

// Remove a player from the list
playerList.removePlayer("Jordan");

Main functionalities

  • Create a list of basketball players with a maximum capacity.
  • Add players to the list with a specified name.
  • Modify the attributes of a player, such as their name, ratings for different skills (e.g., midrange, three-point, dunk), and other attributes (e.g., steal, rebound, contest).
  • Remove a player from the list.

Methods

  • PlayerList(): Constructor method that initializes the player list with default players.
  • getCount(): Returns the current number of players in the list.
  • getMAX(): Returns the maximum capacity of the player list.
  • getPlayer(int index): Returns the player at the specified index in the list.
  • createPlayer(String name): Creates a new player with the specified name and adds them to the list.
  • createPlayer(): Creates a new player without a specified name and adds them to the list.
  • modifyPlayer(): Modifies the attributes of the last added player in the list.
  • pickPlayer(int index): Returns the player at the specified index in the list.
  • playerEditor(int index): Allows the user to edit the attributes of a player at the specified index in the list.
  • edit(char op, int index): Edits a specific attribute of a player at the specified index in the list.
  • removePlayer(String name): Removes a player with the specified name from the list.

Fields

  • pList: An array of Player objects representing the player list.
  • MAX: The maximum capacity of the player list.
  • counter: The current number of players in the list.

About

This project applies some of the OOP and data Structure concepts I learned. I made a simple AI that can play 1 on 1 basketball using methods from the random class, I added attributes to modify the players actions to simulate a real 1v1 basketball game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages