我想帮助实现这个类(java) [英] I want help in implementing this class (java)

查看:60
本文介绍了我想帮助实现这个类(java)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

5 PlayableFighter

名称:PlayableFighter

包装:dragonball.model.character.fighter

类型:Class

描述:(Fighter)类的子类,代表玩家可以选择玩的ghters。不能实例化PlayableFighter类型的对象。该类实现了PlayableCharacter接口。



5.1属性



所有类属性都是READ和WRITE。

1. int xp:ghter目前的经验值。

2. int targetXp:目标体验指出ghter需要达到一个新的水平。

3. int abilityPoints:ghter的能力点数。



5.2施工人员



1.

5 PlayableFighter
Name : PlayableFighter
Package : dragonball.model.character.fighter
Type : Class
Description : Subclass of the (Fighter) class representing ghters that the player can choose to play with. No objects of type PlayableFighter can be instantiated. The class implements the PlayableCharacter interface.

5.1 Attributes

All the class attributes are READ and WRITE.
1. int xp: The current experience points the ghter has.
2. int targetXp: The target experience points the ghter needs to reach the next level.
3. int abilityPoints: The number of ability points the ghter has.

5.2 Constructors

1.

public PlayableFighter(String name, int level, int xp, int targetXp, int maxHealthPoints,int blastDamage, int physicalDamage, int abilityPoints, int maxKi, int maxStamina, ArrayList<SuperAttack> superAttacks, ArrayList<UltimateAttack> ultimateAttacks): 



初始化PlayableFighter对象的所有属性的构造函数。从已保存状态加载播放器时使用。您的构造函数必须使用(Fighter)类的构造函数。任何人都应该将他/她的currentHealthPoints和currentStamina设置为最大值,将currentKi设置为0.



2.


Constructor that initializes all attributes of the PlayableFighter object. Used when loading the Player from a saved state. Your constructor must utilize the constructor of the (Fighter) class. Any fi ghter should have his/her currentHealthPoints and currentStamina set to their maximum value and the currentKi to 0.

2.

public PlayableFighter(String name, int maxHealthPoints, int blastDamage, int physicalDamage, int maxKi, int maxStamina, ArrayList<superattack> superAttacks, ArrayList<ultimateattack>ultimateAttacks):



初始化PlayableFighter的构造函数宾语。您的构造函数应该使用上面的PlayableFighter构造函数。任何ghter应该将他/她的currentHealthPoints和currentStamina设置为其最大值并将currentKi设置为0.



其余属性的默认值应如下传递:


Constructor that initializes a PlayableFighter object. Your constructor should utilize the above PlayableFighter constructor. Any ghter should have his/her currentHealthPoints and currentStamina set to their maximum value and the currentKi to 0.

The default values of the remaining attributes should be passed as follows:

 level: 1
 xp: 0
 targetXp: 10
 abilityPoints: 0





我尝试过:



我不知道如何实现这些承包商



What I have tried:

I dont know how to implement these contractors

推荐答案

我认为你的意思是构造函数,参见https://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html [ ^ ]。
I think you mean constructors, see https://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html[^].


这篇关于我想帮助实现这个类(java)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆