Exemplo n.º 1
0
        public static void Map(GameObject prefab)
        {
            if (prefab is null)
            {
                throw new ArgumentException("The prefab was NULL.");
            }

            ModComponent modComponent = ComponentUtils.GetModComponent(prefab);

            if (modComponent is null)
            {
                throw new ArgumentException("Prefab " + prefab.name + " does not contain a ModComponent.");
            }

            bool hasModPlaceHolder = !(ComponentUtils.GetComponent <ModPlaceHolderComponent>(prefab) is null);

            if (prefab.GetComponent <GearItem>() is null || hasModPlaceHolder)
            {
                ConfigureBehaviours(modComponent);

                EquippableMapper.Configure(modComponent);
                LiquidMapper.Configure(modComponent);
                PowderMapper.Configure(modComponent);
                FoodMapper.Configure(modComponent);
                CookableMapper.Configure(modComponent);
                CookingPotMapper.Configure(modComponent);
                RifleMapper.Configure(modComponent);
                ClothingMapper.Configure(modComponent);
                CollectibleMapper.Configure(modComponent);
                CharcoalMapper.Configure(modComponent);
                PurificationMapper.Configure(modComponent);
                ResearchMapper.Configure(modComponent);
                FirstAidMapper.Configure(modComponent);
                ToolMapper.Configure(modComponent);
                GenericEquippableMapper.Configure(modComponent);
                BedMapper.Configure(modComponent);
                BodyHarvestMapper.Configure(modComponent);

                if (hasModPlaceHolder)
                {
                    return;
                }

                InspectMapper.Configure(modComponent);
                ConfigureGearItem(modComponent);

                mappedItems.Add(modComponent);

                PostProcess(modComponent);
            }
        }
Exemplo n.º 2
0
        public List <Collectible> findAll()
        {
            List <Collectible> Collectibles = new List <Collectible>();

            string sqlCommand = $"SELECT * " +
                                $"FROM collectibles";
            NpgsqlCommand cmd = new NpgsqlCommand(sqlCommand, connection);

            NpgsqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                Collectibles.Add(CollectibleMapper.ToCollectible(reader));
            }

            return(Collectibles);
        }