2010-12-04 16:14:34 +00:00
|
|
|
|
/********************************************************
|
|
|
|
|
* GameComponentCollection.h *
|
|
|
|
|
* *
|
|
|
|
|
* XFX GameComponentCollection definition file *
|
|
|
|
|
* Copyright <EFBFBD> XFX Team. All Rights Reserved *
|
|
|
|
|
********************************************************/
|
|
|
|
|
#ifndef _XFX_GAMECOMPONENTCOLLECTION_
|
|
|
|
|
#define _XFX_GAMECOMPONENTCOLLECTION_
|
|
|
|
|
|
|
|
|
|
#include "Interfaces.h"
|
2012-09-28 20:36:02 +00:00
|
|
|
|
#include <System/Event.h>
|
2011-03-07 19:14:57 +00:00
|
|
|
|
#include <System/Collections/Generic/List.h>
|
2012-09-28 20:36:02 +00:00
|
|
|
|
#include <GameComponentCollectionEventArgs.h>
|
2011-03-07 19:14:57 +00:00
|
|
|
|
|
2012-03-29 22:02:43 +00:00
|
|
|
|
using namespace System;
|
2011-03-07 19:14:57 +00:00
|
|
|
|
using namespace System::Collections::Generic;
|
2010-12-04 16:14:34 +00:00
|
|
|
|
|
|
|
|
|
namespace XFX
|
|
|
|
|
{
|
2011-11-07 01:29:50 +00:00
|
|
|
|
// A collection of game components.
|
2012-09-28 20:36:02 +00:00
|
|
|
|
class GameComponentCollection : public Object
|
2010-12-04 16:14:34 +00:00
|
|
|
|
{
|
2011-03-07 19:14:57 +00:00
|
|
|
|
private:
|
|
|
|
|
List<IGameComponent*> _components;
|
|
|
|
|
|
2010-12-04 16:14:34 +00:00
|
|
|
|
protected:
|
|
|
|
|
void ClearItems();
|
2012-09-28 20:36:02 +00:00
|
|
|
|
void InsertItem(const int index, IGameComponent * const item);
|
|
|
|
|
void RemoveItem(const int index);
|
|
|
|
|
void SetItem(const int index, IGameComponent * const item);
|
2010-12-04 16:14:34 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2012-03-29 22:02:43 +00:00
|
|
|
|
int Count() const;
|
|
|
|
|
|
2010-12-04 16:14:34 +00:00
|
|
|
|
GameComponentCollection();
|
2012-03-29 22:02:43 +00:00
|
|
|
|
virtual ~GameComponentCollection();
|
|
|
|
|
IGameComponent* operator[](const int index);
|
|
|
|
|
|
2012-09-28 20:36:02 +00:00
|
|
|
|
int GetType() const;
|
|
|
|
|
|
|
|
|
|
Event<Object*, GameComponentCollectionEventArgs*> ComponentAdded;
|
|
|
|
|
Event<Object*, GameComponentCollectionEventArgs*> ComponentRemoved;
|
2010-12-04 16:14:34 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif //_XFX_GAMECOMPONENTCOLLECTION_
|