Java - Creating an array of methods

前端 未结 6 2067
温柔的废话
温柔的废话 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:25

    Just have your nodes be objects that all adhere to the same interface, then you'll be able to call their methods reliably.

提交回复
热议问题