public CColor(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name) { Red = new CUInt8(cr2w, this, nameof(Red)); Green = new CUInt8(cr2w, this, nameof(Green)); Blue = new CUInt8(cr2w, this, nameof(Blue)); Alpha = new CUInt8(cr2w, this, nameof(Alpha)); }
public override CVariable SetValue(object val) { this.Value = val switch { byte o => o, string s => byte.Parse(s), CUInt8 v => v.Value, _ => this.Value }; return(this); }