2013-07-12 21:30:13 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* GameComponentCollection.h *
|
|
|
|
* *
|
|
|
|
* XFX GameComponentCollection definition file *
|
|
|
|
* Copyright (c) XFX Team. All Rights Reserved *
|
|
|
|
*****************************************************************************/
|
2013-05-05 18:18:41 +02:00
|
|
|
#ifndef _XFX_GAMECOMPONENTCOLLECTION_
|
|
|
|
#define _XFX_GAMECOMPONENTCOLLECTION_
|
|
|
|
|
|
|
|
#include "Interfaces.h"
|
|
|
|
#include <System/Event.h>
|
|
|
|
#include <System/Collections/Generic/List.h>
|
|
|
|
#include <GameComponentCollectionEventArgs.h>
|
|
|
|
|
|
|
|
using namespace System;
|
|
|
|
using namespace System::Collections::Generic;
|
|
|
|
|
|
|
|
namespace XFX
|
|
|
|
{
|
2013-07-12 21:30:13 +02:00
|
|
|
/**
|
|
|
|
* A collection of game components.
|
|
|
|
*/
|
2013-05-05 18:18:41 +02:00
|
|
|
class GameComponentCollection : public Object
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
List<IGameComponent*> _components;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void ClearItems();
|
|
|
|
void InsertItem(const int index, IGameComponent * const item);
|
|
|
|
void RemoveItem(const int index);
|
|
|
|
void SetItem(const int index, IGameComponent * const item);
|
|
|
|
|
|
|
|
public:
|
|
|
|
int Count() const;
|
|
|
|
|
|
|
|
GameComponentCollection();
|
|
|
|
virtual ~GameComponentCollection();
|
|
|
|
IGameComponent* operator[](const int index);
|
|
|
|
|
2013-07-12 21:30:13 +02:00
|
|
|
static const Type& GetType();
|
2013-05-05 18:18:41 +02:00
|
|
|
|
2013-07-12 21:30:13 +02:00
|
|
|
Event<Object * const, GameComponentCollectionEventArgs * const> ComponentAdded;
|
|
|
|
Event<Object * const, GameComponentCollectionEventArgs * const> ComponentRemoved;
|
2013-05-05 18:18:41 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //_XFX_GAMECOMPONENTCOLLECTION_
|