pmd:AppendCharacterWithChar - Append Character With Char
This commit is contained in:
parent
59c32d3937
commit
7adefc89ba
@ -71,10 +71,10 @@ public class Hero {
|
|||||||
if (hairColor != null || hairType != null) {
|
if (hairColor != null || hairType != null) {
|
||||||
sb.append(" with ");
|
sb.append(" with ");
|
||||||
if (hairColor != null) {
|
if (hairColor != null) {
|
||||||
sb.append(hairColor).append(" ");
|
sb.append(hairColor).append(' ');
|
||||||
}
|
}
|
||||||
if (hairType != null) {
|
if (hairType != null) {
|
||||||
sb.append(hairType).append(" ");
|
sb.append(hairType).append(' ');
|
||||||
}
|
}
|
||||||
sb.append(hairType != HairType.BALD ? "hair" : "head");
|
sb.append(hairType != HairType.BALD ? "hair" : "head");
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ public class Hero {
|
|||||||
if (weapon != null) {
|
if (weapon != null) {
|
||||||
sb.append(" and wielding a ").append(weapon);
|
sb.append(" and wielding a ").append(weapon);
|
||||||
}
|
}
|
||||||
sb.append(".");
|
sb.append('.');
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,11 +114,11 @@ public class Character implements Prototype {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
builder.append("Player: ").append(name).append("\n");
|
builder.append("Player: ").append(name).append('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type != null) {
|
if (type != null) {
|
||||||
builder.append("Character type: ").append(type.name()).append("\n");
|
builder.append("Character type: ").append(type.name()).append('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.append("Stats:\n");
|
builder.append("Stats:\n");
|
||||||
@ -127,7 +127,7 @@ public class Character implements Prototype {
|
|||||||
if (value == null) {
|
if (value == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
builder.append(" - ").append(stat.name()).append(":").append(value).append("\n");
|
builder.append(" - ").append(stat.name()).append(':').append(value).append('\n');
|
||||||
}
|
}
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ public class Character {
|
|||||||
.append(" armed with a ")
|
.append(" armed with a ")
|
||||||
.append(weapon != null ? weapon : spell != null ? spell : "with nothing")
|
.append(weapon != null ? weapon : spell != null ? spell : "with nothing")
|
||||||
.append(abilities != null ? (" and wielding " + abilities + " abilities") : "")
|
.append(abilities != null ? (" and wielding " + abilities + " abilities") : "")
|
||||||
.append(".");
|
.append('.');
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user