Better toString() methods

This commit is contained in:
Daniel Saukel 2018-08-15 23:57:21 +02:00
parent 6db3b1abbf
commit f678136b95
20 changed files with 96 additions and 1 deletions

View File

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>de.erethon</groupId> <groupId>de.erethon</groupId>
<artifactId>dungeonsxl</artifactId> <artifactId>dungeonsxl</artifactId>
<version>0.16.2</version> <version>0.17-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>DungeonsXL</name> <name>DungeonsXL</name>
<url>https://dre2n.github.io</url> <url>https://dre2n.github.io</url>

View File

@ -450,4 +450,9 @@ public class Announcer {
} }
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{name=" + name + /*"; dungeon=" + dungeon + */ "}";
}
} }

View File

@ -130,4 +130,9 @@ public class Dungeon {
return new File(DungeonsXL.DUNGEONS, name + ".yml"); return new File(DungeonsXL.DUNGEONS, name + ".yml");
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{name=" + name + "; multiFloor=" + isMultiFloor() + "}";
}
} }

View File

@ -215,4 +215,9 @@ public class DungeonConfig extends DREConfig {
} }
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{file=" + file.getPath() + "}";
}
} }

View File

@ -463,4 +463,9 @@ public class Game {
} }
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{dungeon=" + getDungeon() + "}";
}
} }

View File

@ -114,4 +114,9 @@ public abstract class GlobalProtection {
*/ */
public abstract Collection<Block> getBlocks(); public abstract Collection<Block> getBlocks();
@Override
public String toString() {
return getClass().getSimpleName() + "{ID=" + id + "}";
}
} }

View File

@ -174,4 +174,9 @@ public class DMob {
return null; return null;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{type=" + type + "}";
}
} }

View File

@ -402,4 +402,9 @@ public class DGlobalPlayer implements PlayerWrapper {
new DGamePlayer(player, gameWorld); new DGamePlayer(player, gameWorld);
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{player=" + player + "}";
}
} }

View File

@ -927,4 +927,9 @@ public class DGroup {
return dGroups; return dGroups;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{name=" + name + "; captain=" + captain + "}";
}
} }

View File

@ -64,4 +64,9 @@ public abstract class Requirement {
public abstract RequirementType getType(); public abstract RequirementType getType();
@Override
public String toString() {
return getClass().getSimpleName() + "{type=" + getType() + "}";
}
} }

View File

@ -62,4 +62,9 @@ public abstract class Reward {
public abstract RewardType getType(); public abstract RewardType getType();
@Override
public String toString() {
return getClass().getSimpleName() + "{type=" + getType() + "}";
}
} }

View File

@ -271,4 +271,9 @@ public abstract class DSign {
public abstract DSignType getType(); public abstract DSignType getType();
@Override
public String toString() {
return getClass().getSimpleName() + "{sign=" + sign + "; gameWorld=" + gameWorld + "}";
}
} }

View File

@ -87,4 +87,9 @@ public class SignScript {
signs.set(index, lines); signs.set(index, lines);
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{name=" + name + "}";
}
} }

View File

@ -212,4 +212,9 @@ public abstract class Trigger {
/* Abstracts */ /* Abstracts */
public abstract TriggerType getType(); public abstract TriggerType getType();
@Override
public String toString() {
return getClass().getSimpleName() + "{type=" + getType() + "}";
}
} }

View File

@ -183,4 +183,9 @@ public abstract class DInstanceWorld {
*/ */
public abstract void delete(); public abstract void delete();
@Override
public String toString() {
return getClass().getSimpleName() + "{name=" + getName() + "}";
}
} }

View File

@ -416,4 +416,9 @@ public class WorldConfig extends GameRuleProvider {
this.worldEnvironment = worldEnvironment; this.worldEnvironment = worldEnvironment;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{file=" + file.getPath() + "}";
}
} }

View File

@ -56,4 +56,9 @@ public abstract class GameBlock {
*/ */
public abstract boolean onBreak(BlockBreakEvent event); public abstract boolean onBreak(BlockBreakEvent event);
@Override
public String toString() {
return getClass().getSimpleName() + "{block=" + block + "}";
}
} }

View File

@ -62,4 +62,9 @@ public class LockedDoor extends GameBlock implements MultiBlock {
state.update(true); state.update(true);
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{block=" + block + "; attachedBlock=" + attachedBlock + "}";
}
} }

View File

@ -95,4 +95,9 @@ public class TeamBed extends TeamBlock implements MultiBlock {
return true; return true;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{block=" + block + "; attachedBlock=" + attachedBlock + "; owner=" + owner + "}";
}
} }

View File

@ -46,4 +46,9 @@ public abstract class TeamBlock extends GameBlock {
this.owner = owner; this.owner = owner;
} }
@Override
public String toString() {
return getClass().getSimpleName() + "{block=" + block + "; owner=" + owner + "}";
}
} }