Non-invocable member '' cannot be used like a method

前端 未结 1 464
生来不讨喜
生来不讨喜 2020-12-07 05:58

I\'m facing a problem right naw. So i\'ll put the code right away;

public static List blockedOpcodes = new List();

    public st         


        
相关标签:
1条回答
  • 2020-12-07 06:30

    Obviously you need

    if (Project_name.Program.blockedOpcodes[current.Opcode] != 0)
    

    instead of this:

    if (Project_name.Program.blockedOpcodes(current.Opcode))
    

    Because blockedOpcodes is a list rather then a method.

    EDIT: You need to compare your list-value against 0 (or whatever you consider to be an "invalid" value) because you store int-values within the list.

    EDIT: To check if a given OpCode is within your list simply call this:

    if (blockedOpcodes.Contains(current.Opcode)) { /* ... */ }
    
    0 讨论(0)
提交回复
热议问题