コード例 #1
0
        public AdminInGridClickableObject(GameObject gameObject, Boolean isAvailable,
                                          IAdminOnClickObject iAdminOnClickObject)
        {
            this.GameObject     = gameObject;
            ClickableGameObject = gameObject.TileObject.Config != null
                ? CreateOfButtons(gameObject)
                : CreateButton(gameObject);

            IsAvailable          = isAvailable;
            _iAdminOnClickObject = iAdminOnClickObject;
        }
コード例 #2
0
        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));
            }
        }