Merge pull request #1089 from gucio321/hotfix3

enum: added String method for d2enum.TileType
This commit is contained in:
gravestench 2021-03-11 22:23:00 -08:00 committed by GitHub
commit ed28ff1176
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 33 additions and 0 deletions

View File

@ -69,3 +69,36 @@ func (tile TileType) Special() bool {
return false
}
func (tile TileType) String() string {
strings := map[TileType]string{
TileFloor: "floor",
TileLeftWall: "Left Wall",
TileRightWall: "Upper Wall",
TileRightPartOfNorthCornerWall: "Upper part of an Upper-Left corner",
TileLeftPartOfNorthCornerWall: "Left part of an Upper-Left corner",
TileLeftEndWall: "Upper-Right corner",
TileRightEndWall: "Lower-Left corner",
TileSouthCornerWall: "Lower-Right corner",
TileLeftWallWithDoor: "Left Wall with Door object, but not always",
TileRightWallWithDoor: "Upper Wall with Door object, but not always",
TileSpecialTile1: "special",
TileSpecialTile2: "special",
TilePillarsColumnsAndStandaloneObjects: "billars, collumns or standalone object",
TileShadow: "shadow",
TileTree: "wall/object",
TileRoof: "roof",
TileLowerWallsEquivalentToLeftWall: "lower wall (left wall)",
TileLowerWallsEquivalentToRightWall: "lower wall (right wall)",
TileLowerWallsEquivalentToRightLeftNorthCornerWall: "lower wall (north corner wall)",
TileLowerWallsEquivalentToSouthCornerwall: "lower wall (south corner wall)",
}
str, found := strings[tile]
if !found {
str = "unknown"
}
return str
}