public int GetId(DatabaseObjectKind kind, string name) { Contract.Requires <ArgumentOutOfRangeException>(kind != DatabaseObjectKind.None); // #NOTE place new DatabaseObjectKind code here switch (kind) { case DatabaseObjectKind.Ability: return(Abilities.TryGetIdWithUndefined(name)); case DatabaseObjectKind.Civ: return(Civs.TryGetIdWithUndefined(name)); case DatabaseObjectKind.DamageType: return(DamageTypes.TryGetIdWithUndefined(name)); case DatabaseObjectKind.ImpactEffect: return(ImpactEffects.TryGetIdWithUndefined(name)); case DatabaseObjectKind.Leader: return(Leaders.TryGetIdWithUndefined(name)); case DatabaseObjectKind.Object: return(Objects.TryGetIdWithUndefined(name)); case DatabaseObjectKind.ObjectType: return(ObjectTypes.TryGetIdWithUndefined(name)); case DatabaseObjectKind.Power: return(Powers.TryGetIdWithUndefined(name)); case DatabaseObjectKind.Squad: return(Squads.TryGetIdWithUndefined(name)); case DatabaseObjectKind.Tactic: return(Tactics.TryGetIdWithUndefined(name)); case DatabaseObjectKind.Tech: return(Techs.TryGetIdWithUndefined(name)); case DatabaseObjectKind.TerrainTileType: return(TerrainTileTypes.TryGetIdWithUndefined(name)); // TODO: Should just use the Objects DBI AFAICT case DatabaseObjectKind.Unit: return(TryGetIdUnit(name)); case DatabaseObjectKind.UserClass: return(UserClasses.TryGetIdWithUndefined(name)); case DatabaseObjectKind.WeaponType: return(WeaponTypes.TryGetIdWithUndefined(name)); default: throw new KSoft.Debug.UnreachableException(kind.ToString()); } }