As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center作为指导。                                                                                                        7年前关闭。                    Board类具有一个Piece的8x8 2D数组,因此,例如,通过执行board.move(piece1, 3, left),我显然可以与Board类一起移动一块,但是我无法简单地告诉它移动,就像,因为它无法了解板子的任何信息(缺少将其作为参数传递),因此它无法将其自身移至特定索引,也无法知道某个部件是否已占用该索引,或者它被告知要移出数组的边界。 (adsbygoogle = window.adsbygoogle || []).push({}); 最佳答案 就一件作品而言,它本身什么都不知道(恰好不需要知道)。因此,无需调用Board方法来移动一块就没有错。关于java - 如果我有一块单独的类(class),而一块木板有一个类(class),那么当它们彼此分开时,我如何告诉该件移动呢? ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12666261/ (adsbygoogle = window.adsbygoogle || []).push({});
10-09 03:23