约 187,000 个结果
在新选项卡中打开链接
    赞成票28最佳答案edited Jan 17, 2013 at 3:42

    You need to rename your private gameOver variable. Change this:

    bool gameOver = false;
    public bool GameOver {
    get { return gameOver; }
    set { gameOver = value; }
    }

    to

    bool _gameOver = false;
    public bool GameOver {
    get { return _gameOver; }
    set { _gameOver = value; }
    }

    You can't use the same variable name in a single class.

    Alternatively, assuming you're using a recent version of .Net, you could remove your private variable and just have:

    public bool GameOver { get; set; }

    Good luck.

    Content Under CC-BY-SA license
    这是否有帮助?
  1. ambiguity between variables in C# - Stack Overflow

  2. ambiguity between | English examples in context | Ludwig

  3. ambiguity between - 英中 – Linguee词典

  4. Ambiguity - Wikipedia

  5. ambiguous between | English examples in context | Ludwig

  6. Definition and Examples of Ambiguity in English

    2024年9月3日 · Ambiguity (pronounced am-big-YOU-it-tee) is the presence of two or more possible meanings in a single passage. The word comes from a Latin term meaning "wandering about." Ambiguous is the adjective form of the …

  7. Ambiguity - ELT Concourse

    If the adverb is not separated by commas or by pausing between separate tone units from the rest of the clause, then some ambiguity arises. For example: Her husband was displeased and she ended up similarly unhappy

  8. On the Trade-Off Between Distributional Belief and Ambiguity ...

  9. Wrong message "ambiguity between X and X" (which are the same)

  10. Compiler Error CS0229 - C# reference | Microsoft Learn