ucsb-cs56-projects / cs56-games-roguelike

-
5 stars 13 forks source link

Rethink the object hierarchy #6

Closed pconrad closed 11 years ago

pconrad commented 11 years ago

The object hierarchy is a bit of a mess. The floor[][] array is an array of plain old Object.

That's not right. It should be array of some kind of thing like Character---a thing that can be placed on the board.

That Character could be either a Player or a Monster. And there are several kinds of Monster.

Should Character be an abstract class or an interface?

Should Monster be an abstract class or an interface?

What should inherit from what? All of these questions deserve a second look, and then the code should be refactored accordingly. There are entirely too many "typecasts" and "instanceof" operators at the moment.

~estimate 200

HMCodingSnowMan commented 11 years ago

claimed ~@hmarasigan @richard-nguyen ~moderator @gonfunko