/// <summary> /// Get as master BackgroundEntity, and /// copy its field {Entity, Hole and Maxnumber of Obstacle} /// Note that Entity has to be cloned properly. /// </summary> /// <param name="bgKey"></param> /// <returns></returns> private static BackgroundEntity GetBackgroundEntity(BgKeys bgKey) { var masterBackgroundEntity = BgEntityDict[bgKey]; return(new BackgroundEntity { Entity = masterBackgroundEntity.Entity.Clone(), Holes = masterBackgroundEntity.Holes, MaxNbObstacles = masterBackgroundEntity.MaxNbObstacles }); }
/// <summary> /// Get as master BackgroundEntity, and /// copy its field {Entity, Hole and Maxnumber of Obstacle} /// Note that Entity has to be cloned properly. /// </summary> /// <param name="bgKey"></param> /// <returns></returns> private static BackgroundEntity GetBackgroundEntity(BgKeys bgKey) { var masterBackgroundEntity = BgEntityDict[bgKey]; return new BackgroundEntity { Entity = masterBackgroundEntity.Entity.Clone(), Holes = masterBackgroundEntity.Holes, MaxNbObstacles = masterBackgroundEntity.MaxNbObstacles }; }