Java - Creating an array of methods

前端 未结 6 2064
温柔的废话
温柔的废话 2020-12-01 01:47

I\'m designing a text-based adventure game for a school progress. I have each \"level\" set up as a class, and each explorable area (node) as a method within the appropriate

6条回答
  •  甜味超标
    2020-12-01 02:23

    Your design has fundamental flaws. Normal OO design would have each "level" be an object (of Class 'level' or something like it). each 'explorable area' would also be an object, contained within the level object - maybe of class ExplorableArea. The 'explorable areas' can be different kinds, in which case you make them different subclasses of ExplorableArea.

提交回复
热议问题