コード例 #1
0
ファイル: Automap.cs プロジェクト: no1453/trizbort
        bool?Match(Room room, string name, string description)
        {
            if (room == null)
            {
                // never match a null room; this shouldn't happen anyway
                return(false);
            }
            if (room.Name != name)
            {
                return(false);
            }

            if (!m_settings.VerboseTranscript)
            {
                // transcript is not verbose;
                // must assume room with same name is same room,
                // otherwise the user has to disambiguate potentially without descriptions, and very frequently.
                return(true);
            }

            if (m_settings.AssumeRoomsWithSameNameAreSameRoom)
            {
                // ignore the description
                return(true);
            }

            if (room.MatchDescription(description))
            {
                // the descriptions match; they're the same room
                return(true);
            }

            // the descriptions don't match; they may or may not be the same room
            return(null);
        }
コード例 #2
0
ファイル: Automap.cs プロジェクト: taradinoc/trizbort
    private bool? Match(Room room, string name, string description)
    {
      if (room == null)
      {
        // never match a null room; this shouldn't happen anyway
        return false;
      }
      if (room.Name != name)
      {
        return false;
      }

      if (!m_settings.VerboseTranscript)
      {
        // transcript is not verbose;
        // must assume room with same name is same room,
        // otherwise the user has to disambiguate potentially without descriptions, and very frequently.
        return true;
      }

      if (m_settings.AssumeRoomsWithSameNameAreSameRoom)
      {
        // ignore the description
        return true;
      }

      if (room.MatchDescription(description))
      {
        // the descriptions match; they're the same room
        return true;
      }

      // the descriptions don't match; they may or may not be the same room
      return null;
    }