Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone help me with my code. I have errors at lines 5 9 , 4 2 , and 4 8 . GameService.java package com
Can someone help me with my code. I have errors at lines and GameService.java
package com aamingroom:
import javasutill. Sist
A singleton service for the game engine
@author coce@
suhu.edu
public class GameSerrice
A list the active games
private static ListGame games new AxayListeGame ;
Holds the next game identifier
private static long rextGpon
privatestaticfinalGamaSericeinstancenewGameServices
make the constructor private so that no other class can create an instance of Garoservice
private GamoSerrices
Returns the game instance at the specified index.
Scope is packagelocal for testing purposes.
@param index indes position in the list to return
@returu requested game instance
Game setGamaint index
return gaves getimdex;
Returns the game instance with the specified id
@param id unique identifier of game to search for
@return requested game instance
public Game getGameflong id
a local game instance
Game gavoe null;
FIXME: Use iterator to look for existing game with game id
if found, simply assign that instance to the local variable
return gama;
Returns the game instance with the specified name.
@param name unique name of game to search for
@return requested game instance
public Game getGameString name
a local game instance
Game gayoe null:
FLXME: Use iterator to look for existing game with same name
if found, simply assign that instance to the local variable
return gama;
Returns the number of games currently active
@return the number of games currently active
public int getGameCGupt
return gavesize:;Specifically, the client has requested that the following software requirements be met for the game application:
It is supposed to be like Draw It or Lose It is loosely similar to the s television game Win, Lose or Draw, where teams compete to guess what is being drawn. Rather than a player drawing images on an easel to help team members guess the puzzle a phrase, title, or thing the application will render images from a large library of stock drawings as clues. A game consists of four rounds of play lasting one minute each. Drawings are rendered at a steady rate and are fully complete at the second mark. If the team does not guess the puzzle before time expires, the remaining teams have an opportunity to offer one guess each to solve the puzzle with a second time limitA game will have the ability to have one or more teams involved.
Each team will have multiple players assigned to it
Game and team names must be unique to allow users to check whether a name is in use when choosing a team name.
Only one instance of the game can exist in memory at any given time. This can be accomplished by creating unique identifiers for each instance of a game, team, or player.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started