diff options
author | Paul Gilbert | 2016-08-15 23:51:31 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-15 23:51:31 -0400 |
commit | 87d9b6682ac1093995f43444c3d8dd915e968dc2 (patch) | |
tree | 1b82fc532f10bc13824cad1550625b8d9b08cfc3 /engines/titanic/core | |
parent | a4885b1d6f783f20716c2d86316946362215bdaa (diff) | |
download | scummvm-rg350-87d9b6682ac1093995f43444c3d8dd915e968dc2.tar.gz scummvm-rg350-87d9b6682ac1093995f43444c3d8dd915e968dc2.tar.bz2 scummvm-rg350-87d9b6682ac1093995f43444c3d8dd915e968dc2.zip |
TITANIC: Implemented CBrainSlot class
Diffstat (limited to 'engines/titanic/core')
-rw-r--r-- | engines/titanic/core/named_item.cpp | 6 | ||||
-rw-r--r-- | engines/titanic/core/named_item.h | 4 | ||||
-rw-r--r-- | engines/titanic/core/tree_item.h | 5 |
3 files changed, 10 insertions, 5 deletions
diff --git a/engines/titanic/core/named_item.cpp b/engines/titanic/core/named_item.cpp index 6eafbf8c8b..9c4c28d04d 100644 --- a/engines/titanic/core/named_item.cpp +++ b/engines/titanic/core/named_item.cpp @@ -51,11 +51,11 @@ void CNamedItem::load(SimpleFile *file) { CTreeItem::load(file); } -int CNamedItem::compareTo(const CString &name, int maxLen) const { +bool CNamedItem::isEquals(const CString &name, int maxLen) const { if (maxLen) { - return getName().left(maxLen).compareToIgnoreCase(name); + return getName().left(maxLen).compareToIgnoreCase(name) == 0; } else { - return getName().compareToIgnoreCase(name); + return getName().compareToIgnoreCase(name) == 0; } } diff --git a/engines/titanic/core/named_item.h b/engines/titanic/core/named_item.h index acd59f344e..9ee3d490ae 100644 --- a/engines/titanic/core/named_item.h +++ b/engines/titanic/core/named_item.h @@ -59,9 +59,9 @@ public: virtual const CString getName() const { return _name; } /** - * Compares the name of the item to a passed name + * Returns true if the item's name matches a passed name */ - virtual int compareTo(const CString &name, int maxLen = 0) const; + virtual bool isEquals(const CString &name, int maxLen = 0) const; /** * Find a parent node for the item diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h index 45ce5164ac..b2d40daab9 100644 --- a/engines/titanic/core/tree_item.h +++ b/engines/titanic/core/tree_item.h @@ -125,6 +125,11 @@ public: virtual const CString getName() const { return CString(); } /** + * Returns true if the item's name matches a passed name + */ + virtual bool isEquals(const CString &name, int maxLen = 0) const { return false; } + + /** * Compares the name of the item to a passed name */ virtual int compareTo(const CString &name, int maxLen = 0) const { return false; } |