/// <summary>
 ///     Assigns every location in the board, to the value
 ///     returned by the <c>CreateInstance</c> method of
 ///     the
 ///     <param name="instantiationCreator"></param>
 ///     .
 ///     This allows for population of the game board,
 ///     and for prefab objects to be instantiated.
 /// </summary>
 /// <param name="instantiationCreator"></param>
 protected void GridInstantiate(IGridInstantiationCreator <T> instantiationCreator)
 {
     foreach (var loc in RowMajorIEnumerator())
     {
         this[loc] = instantiationCreator.CreateInstance(this, loc);
     }
 }
Beispiel #2
0
 public PathGrid(Dimensions <int> dimensions, EnemyPathBase path, PathGridItem prefab) : base(dimensions, prefab)
 {
     this.path    = path;
     instantiator = new PathGridItemInstantiator();
     PopulateGrid();
 }