1
import EternalDungeon
import System.Collections

static def PlayerActivate():
    for x in range(ED.Mobs.Count):
        if ED.Mobs(x).Pos == ED.player.SpaceInFront():
            ED.Mobs(x).OnHit(ED.Sword)
            break

これをコンパイルすると、エラーが発生します

BCE0077: It's not possible to invoke an expression of type 'System.Collections.Generic.List'1[[EternalDungeon.Mob, Eternal Dungeon, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=null]]

(6,15) と (7,16) で。C# では、次のようなアセンブリを含めますが、これはおそらく間違っていて奇妙です。

        compiler.Parameters.References.Add(Assembly.LoadFile(Directory.GetCurrentDirectory() + @"\Eternal Dungeon.exe";));
        compiler.Parameters.References.Add(Assembly.GetAssembly(typeof(System.Collections.Comparer)));

Boo と 'Assemblies' の両方に慣れていません。前もって感謝します。

4

1 に答える 1

1

自分で問題を解決しました。リストと配列を混同しました。

    if ED.Mobs(x).Pos == ED.player.SpaceInFront():

への変更

    if ED.Mobs[x].Pos == ED.player.SpaceInFront():
于 2012-04-15T15:45:51.190 に答える