(svn r17366) -Codechange: make the AI GUIs use the scrollbar wrappers

This commit is contained in:
rubidium
2009-09-02 07:01:25 +00:00
parent b06e026f97
commit 4b9b858127
2 changed files with 54 additions and 39 deletions

View File

@@ -217,6 +217,16 @@ public:
return this->pos;
}
/**
* Checks whether given current item is visible in the list
* @param item to check
* @return true iff the item is visible
*/
FORCEINLINE bool IsVisible(uint16 item) const
{
return IsInsideBS(item, this->GetPosition(), this->GetCapacity());
}
/**
* Sets the number of elements in the list
* @param num the number of elements in the list
@@ -264,7 +274,7 @@ public:
void SetPosition(int position)
{
assert(position >= 0);
assert(this->count <= this->cap ? (position == 0) : (position + this->cap < this->count));
assert(this->count <= this->cap ? (position == 0) : (position + this->cap <= this->count));
this->pos = position;
}