public OptionArgInfo(OptionNames names, string valueName, bool isValueOptional, string description, Visibility visibility) : base(description, visibility) { Names = names ?? throw new ArgumentNullException(nameof(names)); IsValueOptional = isValueOptional; ValueName = valueName ?? DefaultValueName; }
public void Guess(string name1, string name2, string name3, string @short, string @long, string abbr, int count) { var names = OptionNames.Guess(name1, name2, name3); Assert.That(names.Count, Is.EqualTo(count)); if (@short is string sn) { Assert.That(names.ShortName, Is.EqualTo(ShortOptionName.Parse(sn[0]))); } if (@long is string ln) { Assert.That(names.LongName, Is.EqualTo(ln)); } if (abbr is string an) { Assert.That(names.AbbreviatedName, Is.EqualTo(an)); } }
/// <summary> /// Loads all data. Should be positioned on the start /// if the second data hunk. /// </summary> /// <param name="dataReader"></param> public ExecutableData(IDataReader dataReader) { // TODO: For now we search the offset of the filelist manually // until we decode all of the data. dataReader.Position = (int)dataReader.FindString("0Map_data.amb", 0) - 184; // TODO ... FileList = new FileList(dataReader); WorldNames = new WorldNames(dataReader); Messages = new Messages(dataReader); if (dataReader.ReadDword() != 0) { throw new AmbermoonException(ExceptionScope.Data, "Invalid executable data."); } AutomapNames = new AutomapNames(dataReader); OptionNames = new OptionNames(dataReader); SongNames = new SongNames(dataReader); SpellTypeNames = new SpellTypeNames(dataReader); SpellNames = new SpellNames(dataReader); LanguageNames = new LanguageNames(dataReader); ClassNames = new ClassNames(dataReader); RaceNames = new RaceNames(dataReader); AbilityNames = new AbilityNames(dataReader); AttributeNames = new AttributeNames(dataReader); AbilityNames.AddShortNames(dataReader); AttributeNames.AddShortNames(dataReader); ItemTypeNames = new ItemTypeNames(dataReader); AilmentNames = new AilmentNames(dataReader); UITexts = new UITexts(dataReader); // TODO: There is a bunch of binary data (gfx maybe?) // TODO: Then finally the item data comes ... // TODO ... }
protected virtual FlagArgInfo Update(OptionNames names, bool isNegatable, string description, Visibility visibility) => new FlagArgInfo(names, isNegatable, description, visibility);
public FlagArgInfo WithNames(OptionNames value) => Update(value, IsNegatable, Description, Visibility);
public FlagArgInfo(OptionNames names, bool isNegatable, string description, Visibility visibility) : base(description, visibility) { Names = names ?? throw new ArgumentNullException(nameof(names)); IsNegatable = isNegatable; }
public FlagArgInfo(OptionNames names, bool isNegatable, string description) : this(names, isNegatable, description, Visibility.Default) { }
public FlagArgInfo(OptionNames names) : this(names, false, null) { }
protected virtual OptionArgInfo Update(OptionNames names, bool isValueOptional, string valueName, string description, Visibility visibility) => new OptionArgInfo(names, valueName, isValueOptional, description, visibility);
public OptionArgInfo WithNames(OptionNames value) => Update(value, IsValueOptional, ValueName, Description, Visibility);
public OptionArgInfo(OptionNames names, string valueName, bool isValueOptional, string description) : this(names, valueName, isValueOptional, description, Visibility.Default) { }
public OptionArgInfo(OptionNames names, string valueName, string description) : this(names, valueName, false, description) { }
public OptionArgInfo(OptionNames names, string valueName) : this(names, valueName, null) { }
public OptionArgInfo(OptionNames names) : this(names, null) { }