コード例 #1
0
        /// <summary>
        /// 加载资源
        /// </summary>
        /// <param name="path">资源路径</param>
        /// <param name="type">资源类型</param>
        /// <param name="loadType">加载类型</param>
        /// <returns>加载的对象</returns>
        public IObject Load(string path, System.Type type, LoadTypes loadType = LoadTypes.AssetBundle)
        {
            if (loadType == LoadTypes.Resources)
            {
                return(MakeDefaultObjectInfo(UnityEngine.Resources.Load(path, type)));
            }

            path = PathFormat(path, type);

#if UNITY_EDITOR
            if (Env.DebugLevel == DebugLevels.Auto ||
                Env.DebugLevel == DebugLevels.Dev)
            {
                return(MakeDefaultObjectInfo(UnityEditor.AssetDatabase.LoadAssetAtPath(Env.AssetPath.Substring(Env.AssetPath.IndexOf("Assets")) + Path.AltDirectorySeparatorChar + path, type)));
            }
#endif

            IObject hosted;
            if (ResourcesHosted != null)
            {
                hosted = ResourcesHosted.Get(path);
                if (hosted != null)
                {
                    return(hosted);
                }
            }

            var obj = AssetBundleLoader.LoadAsset(path);
            hosted = ResourcesHosted != null?ResourcesHosted.Hosted(path, obj) : MakeDefaultObjectInfo(obj);

            return(hosted);
        }
        public AnAdditionalLoadsView(LoadTypes type)
        {
            _id = Guid.NewGuid();
            switch (type)
            {
            // Todo: case for each
            case LoadTypes.Cooling:
                DistrictControl.Instance.ListOfDistrictLoads.Add(new AdditionalLoads(LoadTypes.Cooling)
                {
                    Id = _id, Name = "Additional Cooling Load"
                });
                break;

            case LoadTypes.Elec:
                DistrictControl.Instance.ListOfDistrictLoads.Add(new AdditionalLoads(LoadTypes.Elec)
                {
                    Id = _id, Name = "Additional Electricity Load"
                });
                break;

            case LoadTypes.Heating:
                DistrictControl.Instance.ListOfDistrictLoads.Add(new AdditionalLoads(LoadTypes.Heating)
                {
                    Id = _id, Name = "Additional Heating Load"
                });
                break;
            }

            InitializeComponent();
            DataContext = new AnAdditionalLoadViewModel {
                Id = _id
            };
        }
コード例 #3
0
        public ACustomModuleView(LoadTypes type)
        {
            _id = Guid.NewGuid();
            IThermalPlantSettings customPlant = null;

            switch (type)
            {
            // Todo: case for each
            case LoadTypes.Cooling:
                customPlant = new CustomCoolingSupplyModule {
                    Id = _id, Name = "New Cooling Supply Module"
                };
                break;

            case LoadTypes.Elec:
                customPlant = new CustomElectricitySupplyModule {
                    Id = _id, Name = "New Electricity Supply Module"
                };
                break;

            case LoadTypes.Heating:
                customPlant = new CustomHeatingSupplyModule {
                    Id = _id, Name = "New Heating Supply Module"
                };
                break;
            }

            DistrictControl.Instance.ListOfPlantSettings.Add(customPlant);

            InitializeComponent();
            DataContext = new ACustomModuleViewModel {
                Id = _id
            };
        }
コード例 #4
0
 public TruckingTerminal(float x, float y, float z, LoadTypes type)
 {
     X    = x;
     Y    = y;
     Z    = z;
     Type = type;
 }
コード例 #5
0
 public PipeNetwork(LoadTypes loadType, string name)
 {
     LoadType = loadType;
     Fill     = new SolidColorBrush(Color.FromRgb(50, 50, 50));
     if (name != null)
     {
         Name = name;
     }
 }
コード例 #6
0
        public override List <Type> FinderAll()
        {
            var typeList = LoadTypes.Where(x => !x.IsAbstract && !x.IsInterface && !x.IsDefined(typeof(IgnoreDependencyAttbuite)) &&
                                           DependencyType.Any(m => m.IsAssignableFrom(x))).ToList();
            //查找类型:
            var attbuitList = LoadTypes.Where(x => !x.IsAbstract && !x.IsInterface && x.IsDefined(typeof(DependencyAttbuite))).ToList();

            typeList.AddRange(attbuitList);
            return(typeList);
        }
コード例 #7
0
 public DataFileInfo(string FilePath, string Delimiter, string StagingTableName, string DataEnclosing, LoadTypes LoadType, bool HasHeader)
 {
     this.blnConsiderNullTrailingCols = true;
     this.strFilePath           = FilePath;
     this.strDelimiter          = Delimiter;
     this.strStagingTableName   = StagingTableName;
     this.strDataEnclosing      = DataEnclosing;
     this.blnConsiderAllColumns = true;
     this.enmLoadType           = LoadType;
     this.blnHasHeader          = HasHeader;
 }
コード例 #8
0
        public override Type[] Find()
        {
            //var b = LoadTypes.ToList();
            //查找类型:当前类型不是抽象类,不是接口,没有忽略注入特性。且当前类型是实现了 三种生命周期
            var typeList = LoadTypes.Where(x => !x.IsAbstract && !x.IsInterface && !x.IsDefined(typeof(IgnoreDependency)) && DependencyType.Any(m => m.IsAssignableFrom(x))).ToList();
            //查找类型:
            var attbuitList = LoadTypes.Where(x => !x.IsAbstract && !x.IsInterface && x.IsDefined(typeof(AttbuiteDependency))).ToList();

            typeList.AddRange(attbuitList);
            return(typeList.Distinct().ToArray());
        }
コード例 #9
0
ファイル: LoadState.cs プロジェクト: sodomon2/dwarfcorp
        public LoadState(DwarfGame game, Overworld settings, LoadTypes LoadType) :
            base(game)
        {
            this.LoadType     = LoadType;
            Settings          = settings;
            EnableScreensaver = true;
            InitialEmbarkment = settings.InstanceSettings.InitalEmbarkment;
            InitialCell       = settings.InstanceSettings.Cell;

            Runner = new DwarfRunner(game);
        }
コード例 #10
0
 // Methods
 public DataFileInfo(string FilePath, string StagingTableName, List <LengthDelimitedColumnMapping> ColumnsMapping, LoadTypes LoadType, bool ConsiderTrailingNullCols)
 {
     this.blnConsiderNullTrailingCols = true;
     this.strFilePath           = FilePath;
     this.strStagingTableName   = StagingTableName;
     this.blnConsiderAllColumns = false;
     this.lstLColMapping        = ColumnsMapping;
     this.lstLColMapping.Sort();
     this.enmLoadType = LoadType;
     this.blnConsiderNullTrailingCols = ConsiderTrailingNullCols;
     this.blnIsLengthDelimitedFile    = true;
 }
コード例 #11
0
        private ICharacter RandomDwarf(ICharacter character, LoadTypes loadType = LoadTypes.InitialBuild)
        {
            var roll = RNG.D(100);

            switch (roll)
            {
            case int n when(n <= 50): return(AddRace(character, Races.Dwarf, Subraces.Dwarf_Hill, loadType));

            case int n when(n <= 100): return(AddRace(character, Races.Dwarf, Subraces.Dwarf_Mountain, loadType));

            default:
                throw new System.Exception();
            }
        }
コード例 #12
0
        private ICharacter RandomGnome(ICharacter character, LoadTypes loadType = LoadTypes.InitialBuild)
        {
            var roll = RNG.D(100);

            switch (roll)
            {
            case int n when(n <= 50): return(AddRace(character, Races.Gnome, Subraces.Gnome_Forest, loadType));

            case int n when(n <= 100): return(AddRace(character, Races.Gnome, Subraces.Gnome_Rock, loadType));

            default:
                throw new System.Exception();
            }
        }
コード例 #13
0
        private ICharacter RandomHalfling(ICharacter character, LoadTypes loadType = LoadTypes.InitialBuild)
        {
            var roll = RNG.D(100);

            switch (roll)
            {
            case int n when(n <= 50): return(AddRace(character, Races.Halfling, Subraces.Halfling_Lightfoot, loadType));

            case int n when(n <= 100): return(AddRace(character, Races.Halfling, Subraces.Halfling_Stout, loadType));

            default:
                throw new System.Exception();
            }
        }
コード例 #14
0
 public DataFileInfo(string FilePath, string Delimiter, string StagingTableName, string DataEnclosing, List <SrcToDestColumnMapping> ColumnsMapping, LoadTypes LoadType, bool ConsiderTrailingNullCols, bool HasHeader)
 {
     this.blnConsiderNullTrailingCols = true;
     this.strFilePath           = FilePath;
     this.strDelimiter          = Delimiter;
     this.strStagingTableName   = StagingTableName;
     this.strDataEnclosing      = DataEnclosing;
     this.blnConsiderAllColumns = false;
     this.lstColMapping         = ColumnsMapping;
     this.lstColMapping.Sort();
     this.intMaxColumnNumber          = this.lstColMapping[this.lstColMapping.Count - 1].SourceColumnNo;
     this.enmLoadType                 = LoadType;
     this.blnConsiderNullTrailingCols = ConsiderTrailingNullCols;
     this.blnHasHeader                = HasHeader;
 }
コード例 #15
0
        private ICharacter RandomElf(ICharacter character, LoadTypes loadType = LoadTypes.InitialBuild)
        {
            var roll = RNG.D(100);

            switch (roll)
            {
            case int n when(n <= 10): return(AddRace(character, Races.Elf, Subraces.Elf_Drow, loadType));

            case int n when(n <= 55): return(AddRace(character, Races.Elf, Subraces.Elf_High, loadType));

            case int n when(n <= 100): return(AddRace(character, Races.Elf, Subraces.Elf_Wood, loadType));

            default:
                throw new System.Exception();
            }
        }
コード例 #16
0
        private ICharacter RandomAasimar(ICharacter character, LoadTypes loadType = LoadTypes.InitialBuild)
        {
            var roll = RNG.D(100);

            switch (roll)
            {
            case int n when(n <= 33): return(AddRace(character, Races.Aasimar, Subraces.Aasimar_Fallen, loadType));

            case int n when(n <= 67): return(AddRace(character, Races.Aasimar, Subraces.Aasimar_Protector, loadType));

            case int n when(n <= 100): return(AddRace(character, Races.Aasimar, Subraces.Aasimar_Scourge, loadType));

            default:
                throw new System.Exception();
            }
        }
コード例 #17
0
        public ICharacter RandomDarkerDungeonBackground(ICharacter character, LoadTypes loadType)
        {
            switch (RNG.D(100))
            {
            case int n when(n < 7):
                return(AddBackground(character, Backgrounds.Acolyte, loadType));

            case int n when(n < 14):
                return(AddBackground(character, Backgrounds.Charlatan, loadType));

            case int n when(n < 21):
                return(AddBackground(character, Backgrounds.Criminal, loadType));

            case int n when(n < 28):
                return(AddBackground(character, Backgrounds.Entertainer, loadType));

            case int n when(n < 35):
                return(AddBackground(character, Backgrounds.FolkHero, loadType));

            case int n when(n < 42):
                return(AddBackground(character, Backgrounds.GuildArtisan, loadType));

            case int n when(n < 49):
                return(AddBackground(character, Backgrounds.Hermit, loadType));

            case int n when(n < 56):
                return(AddBackground(character, Backgrounds.Noble, loadType));

            case int n when(n < 63):
                return(AddBackground(character, Backgrounds.Outlander, loadType));

            case int n when(n < 70):
                return(AddBackground(character, Backgrounds.Sage, loadType));

            case int n when(n < 77):
                return(AddBackground(character, Backgrounds.Sailor, loadType));

            case int n when(n < 84):
                return(AddBackground(character, Backgrounds.Soldier, loadType));

            case int n when(n < 100):
                return(AddBackground(character, Backgrounds.Urchin, loadType));

            default:
                throw new System.InvalidOperationException();
            }
        }
コード例 #18
0
ファイル: Resources.cs プロジェクト: rvpoochen/CatLib
        public IObject[] LoadAll(string path, LoadTypes loadType = LoadTypes.AssetBundle)
        {
            if (loadType == LoadTypes.Resources)
            {
                return(MakeDefaultObjectInfos(UnityEngine.Resources.LoadAll(path)));
            }

            #if UNITY_EDITOR
            if (Env.DebugLevel == DebugLevels.Auto || Env.DebugLevel == DebugLevels.Dev)
            {
                throw new System.Exception("not support [LoadAll] in auto env");
            }
            #endif

            Object[] objs = assetBundleLoader.LoadAssetAll(path);
            return(MakeDefaultObjectInfos(objs));
        }
コード例 #19
0
ファイル: ClassService.cs プロジェクト: nick-codesatori/RPGA2
        public ICharacter RandomDarkerDungeonClass(ICharacter character, int level, LoadTypes loadType)
        {
            switch (RNG.D(100))
            {
            case int n when(n < 8):
                return(AddClass(character, level, Classes.Barbarian, loadType));

            case int n when(n < 16):
                return(AddClass(character, level, Classes.Bard, loadType));

            case int n when(n < 24):
                return(AddClass(character, level, Classes.Cleric, loadType));

            case int n when(n < 32):
                return(AddClass(character, level, Classes.Druid, loadType));

            case int n when(n < 40):
                return(AddClass(character, level, Classes.Fighter, loadType));

            case int n when(n < 48):
                return(AddClass(character, level, Classes.Monk, loadType));

            case int n when(n < 56):
                return(AddClass(character, level, Classes.Paladin, loadType));

            case int n when(n < 64):
                return(AddClass(character, level, Classes.Ranger, loadType));

            case int n when(n < 72):
                return(AddClass(character, level, Classes.Rogue, loadType));

            case int n when(n < 80):
                return(AddClass(character, level, Classes.Sorcerer, loadType));

            case int n when(n < 88):
                return(AddClass(character, level, Classes.Warlock, loadType));

            case int n when(n < 100):
                return(AddClass(character, level, Classes.Wizard, loadType));

            default:
                throw new System.InvalidOperationException();
            }
        }
コード例 #20
0
        private ICharacter RandomDarkerDungeonRace(ICharacter character, LoadTypes loadType = LoadTypes.InitialBuild)
        {
            var roll = RNG.D(100);

            switch (roll)
            {
            case int n when(n <= 1): return(RandomAasimar(character, loadType));

            case int n when(n <= 4): return(AddRace(character, Races.Dragonborn, Subraces.None, loadType));

            case int n when(n <= 19): return(RandomDwarf(character, loadType));

            case int n when(n <= 29): return(RandomElf(character, loadType));

            case int n when(n <= 31): return(AddRace(character, Races.Firbolg, Subraces.None, loadType));

            case int n when(n <= 37): return(RandomGnome(character, loadType));

            case int n when(n <= 39): return(AddRace(character, Races.Goliath, Subraces.None, loadType));

            case int n when(n <= 40): return(AddRace(character, Races.Halfelf, Subraces.None, loadType));

            case int n when(n <= 41): return(AddRace(character, Races.Halforc, Subraces.None, loadType));

            case int n when(n <= 48): return(RandomHalfling(character, loadType));

            case int n when(n <= 90): return(AddRace(character, Races.Human, Subraces.None, loadType));

            case int n when(n <= 91): return(AddRace(character, Races.Kenku, Subraces.None, loadType));

            case int n when(n <= 92): return(AddRace(character, Races.Lizardfolk, Subraces.None, loadType));

            case int n when(n <= 94): return(AddRace(character, Races.Tabaxi, Subraces.None, loadType));

            case int n when(n <= 98): return(AddRace(character, Races.Tiefling, Subraces.None, loadType));

            case int n when(n < 100): return(AddRace(character, Races.Triton, Subraces.None, loadType));

            default:
                throw new System.Exception();
            }
        }
コード例 #21
0
        public IObjectInfo Load(string path, System.Type type, LoadTypes loadType = LoadTypes.AssetBundle)
        {
            if (loadType == LoadTypes.Resources)
            {
                return(MakeDefaultObjectInfo(UnityEngine.Resources.Load(path, type)));
            }

            path = PathFormat(path, type);

            #if UNITY_EDITOR
            if (Env.DebugLevel == DebugLevels.Auto || Env.DebugLevel == DebugLevels.Dev)
            {
                return(MakeDefaultObjectInfo(UnityEditor.AssetDatabase.LoadAssetAtPath("Assets" + Env.ResourcesBuildPath + Path.AltDirectorySeparatorChar + path, type)));
            }
            #endif

            IObjectInfo hosted;
            if (resourcesHosted != null)
            {
                hosted = resourcesHosted.Get(path);
                if (hosted != null)
                {
                    return(hosted);
                }
            }

            Object obj = assetBundleLoader.LoadAsset(path);

            if (resourcesHosted != null)
            {
                hosted = resourcesHosted.Hosted(path, obj);
            }
            else
            {
                hosted = MakeDefaultObjectInfo(obj);
            }
            return(hosted);
        }
コード例 #22
0
        public override List <Type> FinderAll()
        {
            var types = LoadTypes.Where(m => !m.IsAbstract && !m.IsInterface && !m.IsSealed && (typeof(NotifyHandler).IsAssignableFrom(m) || (typeof(IRequestExecute).IsAssignableFrom(m)))).ToList();

            return(types);
        }
コード例 #23
0
 public AdditionalLoads(LoadTypes loadType)
 {
     LoadType = loadType;
 }
コード例 #24
0
        public ICharacter AddBackground(ICharacter character, Backgrounds background = Backgrounds.None, LoadTypes loadType = LoadTypes.InitialBuild)
        {
            switch (background)
            {
            case Backgrounds.Acolyte: return(new Background_Acolyte(character, loadType));

            case Backgrounds.Charlatan: return(new Background_Charlatan(character, loadType));

            case Backgrounds.Criminal: return(new Background_Criminal(character, loadType));

            case Backgrounds.Entertainer: return(new Background_Entertainer(character, loadType));

            case Backgrounds.FolkHero: return(new Background_FolkHero(character, loadType));

            case Backgrounds.GuildArtisan: return(new Background_GuildArtisan(character, loadType));

            case Backgrounds.Hermit: return(new Background_Hermit(character, loadType));

            case Backgrounds.Noble: return(new Background_Noble(character, loadType));

            case Backgrounds.Outlander: return(new Background_Outlander(character, loadType));

            case Backgrounds.Sage: return(new Background_Sage(character, loadType));

            case Backgrounds.Sailor: return(new Background_Sailor(character, loadType));

            case Backgrounds.Soldier: return(new Background_Soldier(character, loadType));

            case Backgrounds.Urchin: return(new Background_Urchin(character, loadType));

            case Backgrounds.Random: return(RandomDarkerDungeonBackground(character, loadType));

            default:
                throw new System.Exception();
            }
        }
コード例 #25
0
 public override List <Type> FinderAll()
 {
     return(LoadTypes.Where(x => !x.IsAbstract && !x.IsInterface && typeof(IEntityTypeRegiest).IsAssignableFrom(x))
            .ToList());
 }
コード例 #26
0
 public GsaLoad(GsaGridPointLoad gridpointload)
 {
     PointLoad = gridpointload;
     LoadType  = LoadTypes.GridPoint;
 }
コード例 #27
0
        public ICharacter AddRace(ICharacter character, Races race = Races.None, Subraces subrace = Subraces.None, LoadTypes loadType = LoadTypes.InitialBuild)
        {
            if (subrace != Subraces.None)
            {
                switch (subrace)
                {
                case Subraces.Aasimar_Fallen: return(new Subrace_Aasimar_Fallen(new Race_Aasimar(character, loadType), loadType));

                case Subraces.Aasimar_Protector: return(new Subrace_Aasimar_Protector(new Race_Aasimar(character, loadType), loadType));

                case Subraces.Aasimar_Scourge: return(new Subrace_Aasimar_Scourge(new Race_Aasimar(character, loadType), loadType));

                case Subraces.Elf_Drow: return(new Subrace_Elf_Drow(new Race_Elf(character, loadType), loadType));

                case Subraces.Elf_High: return(new Subrace_Elf_High(new Race_Elf(character, loadType), loadType));

                case Subraces.Elf_Wood: return(new Subrace_Elf_Wood(new Race_Elf(character, loadType), loadType));

                case Subraces.Dwarf_Hill: return(new Subrace_Dwarf_Hill(new Race_Dwarf(character, loadType), loadType));

                case Subraces.Dwarf_Mountain: return(new Subrace_Dwarf_Mountain(new Race_Dwarf(character, loadType), loadType));

                case Subraces.Gnome_Forest: return(new Subrace_Gnome_Forest(new Race_Gnome(character, loadType), loadType));

                case Subraces.Gnome_Rock: return(new Subrace_Gnome_Rock(new Race_Gnome(character, loadType), loadType));

                case Subraces.Halfling_Lightfoot: return(new Subrace_Halfling_Lightfoot(new Race_Halfling(character, loadType), loadType));

                case Subraces.Halfling_Stout: return(new Subrace_Halfling_Stout(new Race_Halfling(character, loadType), loadType));

                default:
                    throw new System.Exception();
                }
            }
            else
            {
                switch (race)
                {
                case Races.Random: return(RandomDarkerDungeonRace(character, loadType));

                case Races.Aasimar: return(RandomAasimar(character, loadType));

                case Races.Dwarf: return(RandomDwarf(character, loadType));

                case Races.Elf: return(RandomElf(character, loadType));

                case Races.Gnome: return(RandomGnome(character, loadType));

                case Races.Halfling: return(RandomHalfling(character, loadType));

                case Races.Firbolg: return(new Race_Firbolg(character, loadType));

                case Races.Goliath: return(new Race_Goliath(character, loadType));

                case Races.Dragonborn: return(new Race_Dragonborn(character, loadType));

                case Races.Halfelf: return(new Race_Halfelf(character, loadType));

                case Races.Halforc: return(new Race_Halforc(character, loadType));

                case Races.Human: return(new Race_Human(character, loadType));

                case Races.Kenku: return(new Race_Kenku(character, loadType));

                case Races.Lizardfolk: return(new Race_Lizardfolk(character, loadType));

                case Races.Tabaxi: return(new Race_Tabaxi(character, loadType));

                case Races.Triton: return(new Race_Triton(character, loadType));

                case Races.Tiefling: return(new Race_Tiefling(character, loadType));

                default:
                    throw new System.Exception();
                }
            }
        }
コード例 #28
0
ファイル: ClassService.cs プロジェクト: nick-codesatori/RPGA2
        public ICharacter AddClass(ICharacter character, int level, Classes newClass = Classes.None, LoadTypes loadType = LoadTypes.InitialBuild)
        {
            switch (newClass)
            {
            case Classes.Barbarian: return(new Class_Barbarian(character, level, loadType));

            case Classes.Bard: return(new Class_Bard(character, level, loadType));

            case Classes.Cleric: return(new Class_Cleric(character, level, loadType));

            case Classes.Druid: return(new Class_Druid(character, level, loadType));

            case Classes.Fighter: return(new Class_Fighter(character, level, loadType));

            case Classes.Monk: return(new Class_Monk(character, level, loadType));

            case Classes.Paladin: return(new Class_Paladin(character, level, loadType));

            case Classes.Ranger: return(new Class_Ranger(character, level, loadType));

            case Classes.Rogue: return(new Class_Rogue(character, level, loadType));

            case Classes.Sorcerer: return(new Class_Sorcerer(character, level, loadType));

            case Classes.Warlock: return(new Class_Warlock(character, level, loadType));

            case Classes.Wizard: return(new Class_Wizard(character, level, loadType));

            case Classes.Random: return(RandomDarkerDungeonClass(character, level, loadType));

            default:
                throw new System.Exception();
            }
        }
コード例 #29
0
 public GsaLoad(GsaGridLineLoad gridlineload)
 {
     LineLoad = gridlineload;
     LoadType = LoadTypes.GridLine;
 }
コード例 #30
0
 public GsaLoad(GsaGridAreaLoad gridareaload)
 {
     AreaLoad = gridareaload;
     LoadType = LoadTypes.GridArea;
 }