public SaveDataAttribute(ProgramId programId, SaveDataType type, UserId userId, ulong saveDataId, ushort index, SaveDataRank rank) { ProgramId = programId; Type = type; UserId = userId; StaticSaveDataId = saveDataId; Index = index; Rank = rank; }
public static Result Make(out SaveDataAttribute attribute, ProgramId programId, SaveDataType type, UserId userId, ulong staticSaveDataId, ushort index, SaveDataRank rank) { UnsafeHelpers.SkipParamInit(out attribute); SaveDataAttribute tempAttribute = default; tempAttribute.ProgramId = programId; tempAttribute.Type = type; tempAttribute.UserId = userId; tempAttribute.StaticSaveDataId = staticSaveDataId; tempAttribute.Index = index; tempAttribute.Rank = rank; if (!SaveDataTypesValidity.IsValid(in tempAttribute)) { return(ResultFs.InvalidArgument.Log()); } attribute = tempAttribute; return(Result.Success); }
public static SaveDataFilter Make(Optional <ulong> programId, Optional <SaveDataType> saveType, Optional <UserId> userId, Optional <ulong> saveDataId, Optional <ushort> index, SaveDataRank rank) { var filter = new SaveDataFilter(); if (programId.HasValue) { filter.FilterByProgramId = true; filter.Attribute.ProgramId = new ProgramId(programId.Value); } if (saveType.HasValue) { filter.FilterBySaveDataType = true; filter.Attribute.Type = saveType.Value; } if (userId.HasValue) { filter.FilterByUserId = true; filter.Attribute.UserId = userId.Value; } if (saveDataId.HasValue) { filter.FilterBySaveDataId = true; filter.Attribute.StaticSaveDataId = saveDataId.Value; } if (index.HasValue) { filter.FilterByIndex = true; filter.Attribute.Index = index.Value; } filter.Rank = rank; return(filter); }
public static Result Make(out SaveDataFilter filter, Optional <ulong> programId, Optional <SaveDataType> saveType, Optional <UserId> userId, Optional <ulong> saveDataId, Optional <ushort> index, SaveDataRank rank) { UnsafeHelpers.SkipParamInit(out filter); SaveDataFilter tempFilter = Make(programId, saveType, userId, saveDataId, index, rank); if (!SaveDataTypesValidity.IsValid(in tempFilter)) { return(ResultFs.InvalidArgument.Log()); } filter = tempFilter; return(Result.Success); }