📄 gameinit.java
字号:
setRandomSeed ( gameInitAccessor.getRandomSeed ( ) ); setInitialPlayerX ( gameInitAccessor.getInitialPlayerX ( ) ); setInitialPlayerY ( gameInitAccessor.getInitialPlayerY ( ) ); setAmmoDumps ( gameInitAccessor.getAmmoDumps ( ) ); setObstacles ( gameInitAccessor.getObstacles ( ) ); setWorldWidth ( gameInitAccessor.getWorldWidth ( ) ); setWorldHeight ( gameInitAccessor.getWorldHeight ( ) ); setFriendColor ( gameInitAccessor.getFriendColor ( ) ); setEnemyColor ( gameInitAccessor.getEnemyColor ( ) ); setTimeDeltaMax ( gameInitAccessor.getTimeDeltaMax ( ) ); setAttemptsMax ( gameInitAccessor.getAttemptsMax ( ) ); setObstacleRadiusMax ( gameInitAccessor.getObstacleRadiusMax ( ) ); setObstacleRadiusMin ( gameInitAccessor.getObstacleRadiusMin ( ) ); setPlayerTimeout ( gameInitAccessor.getPlayerTimeout ( ) ); setAmmoDumpGrowth ( gameInitAccessor.getAmmoDumpGrowth ( ) ); setAmmoDumpMax ( gameInitAccessor.getAmmoDumpMax ( ) ); setAmmoDumpExplosion ( gameInitAccessor.getAmmoDumpExplosion ( ) ); setAmmoDumpZ ( gameInitAccessor.getAmmoDumpZ ( ) ); } ////////////////////////////////////////////////////////////////////// // accessor methods ////////////////////////////////////////////////////////////////////// public double getTimeFactorDefault ( ) { return timeFactorDefault; } public long getRandomSeed ( ) { return randomSeed; } public double getInitialPlayerX ( ) { return initialPlayerX; } public double getInitialPlayerY ( ) { return initialPlayerY; } public int getAmmoDumps ( ) { return ammoDumps; } public int getObstacles ( ) { return obstacles; } public int getWorldWidth ( ) { return worldWidth; } public int getWorldHeight ( ) { return worldHeight; } public Color getFriendColor ( ) { return friendColor; } public Color getEnemyColor ( ) { return enemyColor; } public double getTimeDeltaMax ( ) { return timeDeltaMax; } public int getAttemptsMax ( ) { return attemptsMax; } public double getObstacleRadiusMax ( ) { return obstacleRadiusMax; } public double getObstacleRadiusMin ( ) { return obstacleRadiusMin; } public long getPlayerTimeout ( ) { return playerTimeout; } public double getAmmoDumpGrowth ( ) { return ammoDumpGrowth; } public double getAmmoDumpMax ( ) { return ammoDumpMax; } public double getAmmoDumpExplosion ( ) { return ammoDumpExplosion; } public double getAmmoDumpZ ( ) { return ammoDumpZ; } ////////////////////////////////////////////////////////////////////// // mutator methods ////////////////////////////////////////////////////////////////////// public void setTimeFactorDefault ( double timeFactorDefault ) ////////////////////////////////////////////////////////////////////// { this.timeFactorDefault = timeFactorDefault; } public void setRandomSeed ( long randomSeed ) ////////////////////////////////////////////////////////////////////// { this.randomSeed = randomSeed; } public void setInitialPlayerX ( double initialPlayerX ) ////////////////////////////////////////////////////////////////////// { this.initialPlayerX = initialPlayerX; } public void setInitialPlayerY ( double initialPlayerY ) ////////////////////////////////////////////////////////////////////// { this.initialPlayerY = initialPlayerY; } public void setAmmoDumps ( int ammoDumps ) ////////////////////////////////////////////////////////////////////// { this.ammoDumps = ammoDumps; } public void setObstacles ( int obstacles ) ////////////////////////////////////////////////////////////////////// { this.obstacles = obstacles; } public void setWorldWidth ( int worldWidth ) ////////////////////////////////////////////////////////////////////// { this.worldWidth = worldWidth; } public void setWorldHeight ( int worldHeight ) ////////////////////////////////////////////////////////////////////// { this.worldHeight = worldHeight; } public void setFriendColor ( Color friendColor ) ////////////////////////////////////////////////////////////////////// { NullArgumentException.check ( this.friendColor = friendColor ); } public void setEnemyColor ( Color enemyColor ) ////////////////////////////////////////////////////////////////////// { NullArgumentException.check ( this.enemyColor = enemyColor ); } public void setTimeDeltaMax ( double timeDeltaMax ) ////////////////////////////////////////////////////////////////////// { this.timeDeltaMax = timeDeltaMax; } public void setAttemptsMax ( int attemptsMax ) ////////////////////////////////////////////////////////////////////// { this.attemptsMax = attemptsMax; } public void setObstacleRadiusMax ( double obstacleRadiusMax ) ////////////////////////////////////////////////////////////////////// { this.obstacleRadiusMax = obstacleRadiusMax; } public void setObstacleRadiusMin ( double obstacleRadiusMin ) ////////////////////////////////////////////////////////////////////// { this.obstacleRadiusMin = obstacleRadiusMin; } public void setPlayerTimeout ( long playerTimeout ) ////////////////////////////////////////////////////////////////////// { this.playerTimeout = playerTimeout; } public void setAmmoDumpGrowth ( double ammoDumpGrowth ) ////////////////////////////////////////////////////////////////////// { this.ammoDumpGrowth = ammoDumpGrowth; } public void setAmmoDumpMax ( double ammoDumpMax ) ////////////////////////////////////////////////////////////////////// { this.ammoDumpMax = ammoDumpMax; } public void setAmmoDumpExplosion ( double ammoDumpExplosion ) ////////////////////////////////////////////////////////////////////// { this.ammoDumpExplosion = ammoDumpExplosion; } public void setAmmoDumpZ ( double ammoDumpZ ) ////////////////////////////////////////////////////////////////////// { this.ammoDumpZ = ammoDumpZ; } ////////////////////////////////////////////////////////////////////// // overridden object methods ////////////////////////////////////////////////////////////////////// public boolean equals ( Object other ) ////////////////////////////////////////////////////////////////////// { if ( other == null ) { return false; } if ( other.getClass ( ) != getClass ( ) ) { return false; } GameInit otherGameInit = ( GameInit ) other; return ( timeFactorDefault == otherGameInit.timeFactorDefault ) && ( randomSeed == otherGameInit.randomSeed ) && ( initialPlayerX == otherGameInit.initialPlayerX ) && ( initialPlayerY == otherGameInit.initialPlayerY ) && ( ammoDumps == otherGameInit.ammoDumps ) && ( obstacles == otherGameInit.obstacles ) && ( worldWidth == otherGameInit.worldWidth ) && ( worldHeight == otherGameInit.worldHeight ) && friendColor.equals ( otherGameInit.friendColor ) && enemyColor.equals ( otherGameInit.enemyColor ) && ( timeDeltaMax == otherGameInit.timeDeltaMax ) && ( attemptsMax == otherGameInit.attemptsMax ) && ( obstacleRadiusMax == otherGameInit.obstacleRadiusMax ) && ( obstacleRadiusMin == otherGameInit.obstacleRadiusMin ) && ( playerTimeout == otherGameInit.playerTimeout ) && ( ammoDumpGrowth == otherGameInit.ammoDumpGrowth ) && ( ammoDumpMax == otherGameInit.ammoDumpMax ) && ( ammoDumpExplosion == otherGameInit.ammoDumpExplosion ) && ( ammoDumpZ == otherGameInit.ammoDumpZ ); } ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -