【发布时间】:2016-05-30 08:18:08
【问题描述】:
我有一个名为“Player”的非抽象类,以及一个名为“Score”的抽象类,其子类是“Combination”。在 Combination 中,还有在其他子类中使用的抽象方法。
如何从非父方法“Player”调用我的抽象方法而不使它们成为静态的?
// This is the abstract method within Combination,
// it uses the face values from rolled dice to calculate the score.
abstract public int CalculateScore(int[] faceValues);
//Array of 'Score's in Player
private Score[] scores = new Score[10];
【问题讨论】:
-
你能提供更多关于播放器和组合类的信息吗? faceValues 是什么意思?
标签: c# abstract-class abstract