快速的問題真的:我有這樣的代碼:奇怪的編譯器錯誤
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Hovel {
public abstract class DamageType {
public string GetKillString(string instigatorName, string victimName) {
return killString.Replace("<inst>", instigatorName).Replace("<vict>", victimName);
}
protected string killString = "ERROR_NO_KILLSTRING_DEFINED";
public string GetDamageString(string instigatorName, string victimName) {
return damageString.Replace("<inst>", instigatorName).Replace("<vict>", victimName);
}
protected string damageString = "ERROR_NO_DAMAGESTRING_DEFINED";
}
public class DamageType_Default : DamageType {
killString = "ERROR_DEFAULT_DAMAGE_TYPE";
damageString = "ERROR_DEFAULT_DAMAGE_TYPE";
}
}
對我來說,這看起來不錯,但我得到了在DamageType_Default的只有兩行此錯誤:
Invalid token '=' in class, struct, or interface member declaration
所以...什麼?
啊,謝謝...我應該去睡覺吧,嘿。 :) – Xenoprimate 2010-10-15 04:08:21
@Motig或只是喝更多的紅寶石:) – JaredPar 2010-10-15 04:08:55