Example #1
0
		/// <summary>
		/// Init this instance.
		/// </summary>
		public void Init()
		{
			m_InputManager = new InputManager();
			m_Grid = new Grid();
			m_Grid.Load(GRID_DATA_FILE_NAME);
			m_CollisionDetection = new CollisionDetection(m_Grid);
			SpawnManager spawnManager = new SpawnManager(new ActorFactory(m_InputManager, new PlayerController(m_CollisionDetection), m_CollisionDetection));
			spawnManager.LoadData(SPAWN_DATA_FILE_NAME);
			m_Actors = spawnManager.Spawn(m_Grid);
			m_CollisionDetection.Init(m_Actors);
		}
Example #2
0
		public ActorFactory(InputManager inputManager, PlayerController playerController, CollisionDetection collisionDetection)
		{
			IntToActorType = new Dictionary<int, CreateActorAction>()
			{
				{0, CreatePlayer},
				{1, CreateBrick},
				{2, CreateBomb},
			};

			m_InputManager = inputManager;
			m_PlayerController = playerController;
			m_CollisionDetection = collisionDetection;
		}