public AdminInGridClickableObject(GameObject gameObject, Boolean isAvailable, IAdminOnClickObject iAdminOnClickObject) { this.GameObject = gameObject; ClickableGameObject = gameObject.TileObject.Config != null ? CreateOfButtons(gameObject) : CreateButton(gameObject); IsAvailable = isAvailable; _iAdminOnClickObject = iAdminOnClickObject; }
public AdminGridObjectsCreator(GameObject[] gameObjects, bool isAvailable, Grid objectsGrid, IAdminOnClickObject adminOnClickObject) { if (isAvailable) { Console.WriteLine(""); foreach (var VARIABLE in gameObjects) { Console.WriteLine( $"{VARIABLE.TileObject.Name}, price {VARIABLE.Price}, val {VARIABLE.ChangeValue}"); } } this.isAvailable = isAvailable; ObjectsGrid = objectsGrid; GameObjectsList = new List <AdminInGridClickableObject>(gameObjects.Length); var copy = gameObjects.Select(gameObject => new GameObject(gameObject.TileObject, gameObject.ChangeValue, gameObject.Price)).ToList(); foreach (var gameObject in copy) { GameObjectsList.Add(new AdminInGridClickableObject(gameObject, isAvailable, adminOnClickObject)); } }