- Sync scripting branch with what was in trunk on Sunday. I believe that would be revision 2739.
SVN r2790 (scripting)
This commit is contained in:
commit
99670b708c
317 changed files with 17299 additions and 7273 deletions
22
src/tarray.h
22
src/tarray.h
|
|
@ -153,12 +153,27 @@ public:
|
|||
{
|
||||
return Array[index];
|
||||
}
|
||||
// Returns a reference to the last element
|
||||
T &Last() const
|
||||
{
|
||||
return Array[Count-1];
|
||||
}
|
||||
|
||||
unsigned int Push (const T &item)
|
||||
{
|
||||
Grow (1);
|
||||
::new((void*)&Array[Count]) T(item);
|
||||
return Count++;
|
||||
}
|
||||
bool Pop ()
|
||||
{
|
||||
if (Count > 0)
|
||||
{
|
||||
Array[--Count].~T();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool Pop (T &item)
|
||||
{
|
||||
if (Count > 0)
|
||||
|
|
@ -183,10 +198,13 @@ public:
|
|||
|
||||
void Delete (unsigned int index, int deletecount)
|
||||
{
|
||||
if (index + deletecount > Count) deletecount = Count - index;
|
||||
if (index + deletecount > Count)
|
||||
{
|
||||
deletecount = Count - index;
|
||||
}
|
||||
if (deletecount > 0)
|
||||
{
|
||||
for(int i = 0; i < deletecount; i++)
|
||||
for (int i = 0; i < deletecount; i++)
|
||||
{
|
||||
Array[index + i].~T();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue