小编Her*_*ong的帖子

C#Boolean外部方法将无法读取

我有一个问题,这可能是非常的,但我在过去的3天里一直坚持下去.我有一个名为ApplyRules的方法,它经常被使用,因此我无法在其中定义bool,但是当我尝试在方法之外定义它时,它不会读取它.这是我的代码:

public bool solvedp1 = false;

    public static void ApplyRules()
    {

        if (Level.Rooms[0, 0].GetItem("Red Gem") != null
            & Level.Rooms[1, 0].GetItem("Blue Gem") != null
            & solvedp1 == false)
        {
            Console.Clear();
            Console.WriteLine("You put the gem in its correct place. As soon as the gem is in position, you feel a shiver and a warm feeling enters your toes and passes through your whole body. The strange feeling in the room is gone. You hear a lock unlocking and a door shrieking as …
Run Code Online (Sandbox Code Playgroud)

c# boolean

0
推荐指数
1
解决办法
265
查看次数

标签 统计

boolean ×1

c# ×1