我确定这很简单。我对 C# 不是很熟悉(我实际上是从 C++ 移植过来的)。
单击“确定”后,我正在调用 CalculateFrontages 类中的 CalculateLines 方法(片段):
private void Button_Click(object sender, RoutedEventArgs e)
{
// MessageBox.Show("User clicked OK");
string value = MSTGapThresholdInMeters.Text;
MSTGapValue = Int32.Parse(value);
MainWindowViewModel.RedTLS = CalculateFrontages.CalculateLines(MainWindowViewModel.RedArmy, Map.MetersPerPixel, MSTGapValue);
MainWindowViewModel.BlueTLS = CalculateFrontages.CalculateLines(MainWindowViewModel.BlueArmy, Map.MetersPerPixel, MSTGapValue);
this.DialogResult = true;
}
这是我要调用的另一个类 CalculateFrontages 中的方法 CalculateLines(片段):
namespace TacticalAILib
{
public class CalculateFrontages
{
static int[] U;
private static TacLineStruct CalculateLines(List<MATEUnit> Army, double MetersPerPixel, int MSTGapValue)
{
int TempFrom, TempTo;
float TempWeight;
int NumEdges = 0;
double Threshold = MetersPerPixel * MSTGapValue;
U = new int[Army.Count];
它抛出了这个编译器错误:
错误 CS0426 类型名称“CalculateLines”在类型“CalculateFrontages”中不存在
我认为这是范围错误或声明错误。我只是对此了解不够。
茅侃侃
相关分类