문제

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

When this is compiled, I get the error

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]]

At (6,15) and (7,16). In C# I include assemblies like so, which is probably wrong and wierd:

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

Any help is appreciated, and I'm rather new to both Boo and 'Assemblies'. Thanks in advance.

도움이 되었습니까?

해결책

Solved the problem myself, I confused lists for arrays,

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

Changes to

    if ED.Mobs[x].Pos == ED.player.SpaceInFront():
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top