- 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:
Randy Heit 2010-09-16 03:14:32 +00:00
commit 99670b708c
317 changed files with 17299 additions and 7273 deletions

View file

@ -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();
}