/// <summary> /// 获取游戏包类型的字符串表示 /// </summary> /// <param name="type">游戏包类型</param> /// <returns>EP, SP, 或者空字符串.</returns> public static string GetName(GamePackTypes type) { switch (type) { case GamePackTypes.Ep: return("EP"); case GamePackTypes.Sp: return("SP"); default: return(string.Empty); } }
private GamePack(int index, GamePackTypes type, int pIndex, GamePackNames name, string game, string display) { this.Index = index; this.Type = type; this.PIndex = pIndex; this.Name = name; this.RegName = game; this.DisplayName = display; if (type == GamePackTypes.Base) { this.PackName = String.Empty; } else { this.PackName = GamePackType.GetName(type) + pIndex.ToString().PadLeft(2, '0'); } this.Ts3Name = Ts3Head + this.PackName; }
/// <summary>Generates a random role list from this given role list, replacing wildcard slots with randomly chosen ones fitting the given criteria.</summary> /// <param name="packTypes">The game pack types where this role list is applied on.</param> /// <returns>The generated role list if this role list is valid, otherwise <see langword="null"/>.</returns> public RoleList GenerateRandomRoleList(GamePackTypes packTypes) { return(GenerateRandomRoleList(new RoleCollection(RoleCollection.AllAvailableRolesCollection.GetAllStartableRoleTypesIntersection(packTypes)))); }
/// <summary>Determines whether this current role list is a valid one.</summary> /// <param name="packTypes">The game pack types where this role list is applied on.</param> public bool IsValidRoleList(GamePackTypes packTypes) => ValidateRoleList(packTypes, out _);
private bool ValidateRoleList(GamePackTypes packTypes, out ValueCounterDictionary <Type> remainingSlots) { return(ValidateRoleList(new RoleCollection(RoleCollection.AllAvailableRolesCollection.GetAllStartableRoleTypesIntersection(packTypes)), out remainingSlots)); }
/// <summary> /// 创建一个用于具有指定读写权限的模拟人生3游戏包注册表信息的一个实例 /// </summary> /// <param name="type">游戏类别</param> /// <param name="index">只有原版用0表示, 其它为EP01或SP01中的数字部分. 为了与官方表示方式一致, 此处序号从1开始.</param> /// <param name="writable">是否以可读写的方式创建</param> public SimsRegistryInfo(GamePackTypes type, int index, bool writable) : this(GamePack.GetGamePackByType(type, index), writable) { }
/// <summary> /// <para>创建一个用于获取模拟人生3游戏包注册表信息的一个实例</para> /// <para>如果需要修改注册表中的值, 请参见其重载构造方法.</para> /// </summary> /// <param name="type">游戏类别</param> /// <param name="index">只有原版用0表示, 其它为EP01或SP01中的数字部分. 为了与官方表示方式一致, 此处序号从1开始.</param> public SimsRegistryInfo(GamePackTypes type, int index) : this(type, index, false) { }
/// <summary> /// 通过类别和序号来查找游戏包 /// </summary> /// <param name="type">类别</param> /// <param name="index">只有原版用0表示, 其它为EP01或SP01中的数字部分. 为了与官方表示方式一致, 此处序号从1开始.</param> public static GamePack GetGamePackByType(GamePackTypes type, int index) { switch (type) { case GamePackTypes.Base: if (index == 0) { return(Base); } else { break; } case GamePackTypes.Ep: if (index == 1) { return(Ep01); } else if (index == 2) { return(Ep02); } else if (index == 3) { return(Ep03); } else if (index == 4) { return(Ep04); } else if (index == 5) { return(Ep05); } else if (index == 6) { return(Ep06); } else if (index == 7) { return(Ep07); } else if (index == 8) { return(Ep08); } else if (index == 9) { return(Ep09); } else { break; } case GamePackTypes.Sp: if (index == 1) { return(Sp01); } else if (index == 2) { return(Sp02); } else if (index == 3) { return(Sp03); } else if (index == 4) { return(Sp04); } else if (index == 5) { return(Sp05); } else if (index == 6) { return(Sp06); } else if (index == 7) { return(Sp07); } else if (index == 8) { return(Sp08); } else { break; } default: break; } return(null); }