행을 찾는 방법
조회 함수는 인덱스마다 셋이 생성되고, 이름은 그 인덱스의 컬 럼에서 만들어집니다.
| 함수 | 없을 때 |
|---|---|
FindBy… | 널을 반환합니다 |
GetBy…OrThrow | 예외를 발생시킵니다 |
Contains… | 존재 여부만 확인합니다 |
이름이 동작을 설명하므로, 검사를 빠뜨린 자리가 코드를 읽는 것만으로 드러납니다.
첫 필드 컬럼이 기본 인덱스이고, 이름 앞에 * 를 붙이면 보조
인덱스가 하나 더 생깁니다.
- C#
- TypeScript
- C++
- Python
- C
- Dart
- Go
- Java
- Kotlin
- Lua
- PHP
- Ruby
- Rust
- Swift
- Unreal
[System.Serializable]
public partial class AnimationRecord
{
#region Values
/// <summary>
/// primary index
/// </summary>
public string Index => _index;
/// <summary>
/// secondary index
/// </summary>
public int Slot => _slot;
/// <summary>
/// anything
/// </summary>
public float Blend => _blend;
#endregion
#region Storage
internal string _index = "";
internal int _slot;
internal float _blend;
#endregion
#region ToString
public override string ToString()
{
var sb = new StringBuilder("{");
sb.Append("\"Index\":"); ToStringHelper.ToString(Index, sb);
sb.Append(",\"Slot\":"); ToStringHelper.ToString(Slot, sb);
sb.Append(",\"Blend\":"); ToStringHelper.ToString(Blend, sb);
sb.Append("}");
return sb.ToString();
}
#endregion
}
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : B2
/** Keyed by name, with a second key beside it. */
export class AnimationRecord {
/** Default constructor */
constructor() {
}
/** primary index */
public get index(): string { return this._index }
/** secondary index */
public get slot(): number { return this._slot }
/** anything */
public get blend(): number { return this._blend }
public _index: string = ''
public _slot: number = 0
public _blend: number = 0
/** Populate field values. */
public populateFieldValues(dataRow: IDataRow): void {
this._index = dataRow.index
this._slot = dataRow.slot
this._blend = Math.fround(dataRow.blend)
}
/** Populate field values. */
public populateFieldValuesCompact(dataRow: any[]): void {
let offset = 0
this._index = dataRow[offset++]
this._slot = dataRow[offset++]
this._blend = Math.fround(dataRow[offset++])
}
}
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : B2
/// Keyed by name, with a second key beside it.
struct AnimationRecord {
/// primary index
std::string index;
/// secondary index
std::int32_t slot = 0;
/// anything
float blend = 0.0f;
};
class AnimationRecord:
"""Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : B2.
Keyed by name, with a second key beside it.
"""
__slots__ = ("index", "slot", "blend")
def __init__(self):
self.index = ""
self.slot = 0
self.blend = 0.0
def __repr__(self):
return "AnimationRecord(index=%r, slot=%r, blend=%r)" % (self.index, self.slot, self.blend)
/* Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : B2
*
* Keyed by name, with a second key beside it.
*/
struct DocShowcase_AnimationRecord_t {
/* primary index */
const char* index;
/* secondary index */
int32_t slot;
/* anything */
float blend;
};
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : B2
/// Keyed by name, with a second key beside it.
class AnimationRecord {
/// primary index
String index = '';
/// secondary index
int slot = 0;
/// anything
double blend = 0.0;
}
// AnimationRecord was generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : B2.
// Keyed by name, with a second key beside it.
type AnimationRecord struct {
// primary index
Index string
// secondary index
Slot int32
// anything
Blend float32
}
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : B2
/** Keyed by name, with a second key beside it. */
public final class AnimationRecord {
/** primary index */
public String index = "";
/** secondary index */
public int slot;
/** anything */
public float blend;
}
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : B2
/** Keyed by name, with a second key beside it. */
class AnimationRecord {
/** primary index */
var index: String = ""
/** secondary index */
var slot: Int = 0
/** anything */
var blend: Float = 0.0f
}
-- Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : B2.
-- Keyed by name, with a second key beside it.
---@class AnimationRecord
---@field index string
---@field slot integer
---@field blend number
local AnimationRecordMeta = tcb.strictType("a `Animation` row", { "index", "slot", "blend" })
/**
* Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : B2
*
* Keyed by name, with a second key beside it.
*/
final class AnimationRecord
{
/** primary index */
public string $index = '';
/** secondary index */
public int $slot = 0;
/** anything */
public float $blend = 0.0;
}
# Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : B2
# Keyed by name, with a second key beside it.
class AnimationRecord
attr_accessor :index, :slot, :blend
def initialize
@index = ''
@slot = 0
@blend = 0.0
end
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : B2
/// Keyed by name, with a second key beside it.
#[derive(Clone, Debug, Default)]
pub struct AnimationRecord {
/// primary index
pub index: String,
/// secondary index
pub slot: i32,
/// anything
pub blend: f32,
}
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : B2
/// Keyed by name, with a second key beside it.
public final class AnimationRecord {
public init() {}
/// primary index
public var index: String = ""
/// secondary index
public var slot: Int32 = 0
/// anything
public var blend: Float = 0
}
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : B2
/** Keyed by name, with a second key beside it. */
USTRUCT(BlueprintType)
struct DOCSHOWCASE_API FAnimationRow
{
GENERATED_BODY()
/** primary index */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Animation")
FString Index;
/** secondary index */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Animation")
int32 Slot = 0;
/** anything */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Animation")
float Blend = 0.0f;
};
조회 함수는 레코드가 아니라 테이블에 생깁니다 — 여기 보이는 것은
멤버뿐입니다. index 가 문자열이므로 그 테이블의 조회는 문자열을 받고, *Slot 때문에
정수로 찾는 조회가 하나 더 생깁니다.
어느 컬럼 하나로도 행을 가릴 수 없을 때 선언 셀의 괄호에 키를
적습니다 — :table StageReward(key="Stage,Rank") 입니다.
- C#
- TypeScript
- C++
- Python
- C
- Dart
- Go
- Java
- Kotlin
- Lua
- PHP
- Ruby
- Rust
- Swift
- Unreal
[System.Serializable]
public partial class StageRewardRecord
{
#region Values
/// <summary>
/// which stage
/// </summary>
public int Stage => _stage;
/// <summary>
/// finishing rank
/// </summary>
public global::Tabbit.Fixtures.DocShowcase.Rarity Rank => _rank;
/// <summary>
/// gold paid
/// </summary>
public int Gold => _gold;
/// <summary>
/// drop table
/// </summary>
public string DropTable => _dropTable;
#endregion
#region Storage
internal int _stage;
internal global::Tabbit.Fixtures.DocShowcase.Rarity _rank;
internal int _gold;
internal string _dropTable = "";
#endregion
#region ToString
public override string ToString()
{
var sb = new StringBuilder("{");
sb.Append("\"Stage\":"); ToStringHelper.ToString(Stage, sb);
sb.Append(",\"Rank\":"); ToStringHelper.ToString(Rank, sb);
sb.Append(",\"Gold\":"); ToStringHelper.ToString(Gold, sb);
sb.Append(",\"DropTable\":"); ToStringHelper.ToString(DropTable, sb);
sb.Append("}");
return sb.ToString();
}
#endregion
}
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Sides : B2
/** Neither key column is unique alone. */
export class StageRewardRecord {
/** Default constructor */
constructor() {
}
/** which stage */
public get stage(): number { return this._stage }
/** finishing rank */
public get rank(): Rarity { return this._rank }
/** gold paid */
public get gold(): number { return this._gold }
/** drop table */
public get dropTable(): string { return this._dropTable }
public _stage: number = 0
public _rank: Rarity = 0 as Rarity
public _gold: number = 0
public _dropTable: string = ''
/** Populate field values. */
public populateFieldValues(dataRow: IDataRow): void {
this._stage = dataRow.stage
this._rank = dataRow.rank
this._gold = dataRow.gold
this._dropTable = dataRow.dropTable
}
/** Populate field values. */
public populateFieldValuesCompact(dataRow: any[]): void {
let offset = 0
this._stage = dataRow[offset++]
this._rank = dataRow[offset++]
this._gold = dataRow[offset++]
this._dropTable = dataRow[offset++]
}
}
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Sides : B2
/// Neither key column is unique alone.
struct StageRewardRecord {
/// which stage
std::int32_t stage = 0;
/// finishing rank
Rarity rank = static_cast<Rarity>(0);
/// gold paid
std::int32_t gold = 0;
/// drop table
std::string drop_table;
};
class StageRewardRecord:
"""Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Sides : B2.
Neither key column is unique alone.
"""
__slots__ = ("stage", "rank", "gold", "drop_table")
def __init__(self):
self.stage = 0
self.rank = Rarity(0)
self.gold = 0
self.drop_table = ""
def __repr__(self):
return "StageRewardRecord(stage=%r, rank=%r, gold=%r, drop_table=%r)" % (self.stage, self.rank, self.gold, self.drop_table)
/* Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Sides : B2
*
* Neither key column is unique alone.
*/
struct DocShowcase_StageRewardRecord_t {
/* which stage */
int32_t stage;
/* finishing rank */
DocShowcase_Rarity_t rank;
/* gold paid */
int32_t gold;
/* drop table */
const char* drop_table;
};
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Sides : B2
/// Neither key column is unique alone.
class StageRewardRecord {
/// which stage
int stage = 0;
/// finishing rank
Rarity rank = Rarity.of(0);
/// gold paid
int gold = 0;
/// drop table
String dropTable = '';
}
// StageRewardRecord was generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Sides : B2.
// Neither key column is unique alone.
type StageRewardRecord struct {
// which stage
Stage int32
// finishing rank
Rank Rarity
// gold paid
Gold int32
// drop table
DropTable string
}
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Sides : B2
/** Neither key column is unique alone. */
public final class StageRewardRecord {
/** which stage */
public int stage;
/** finishing rank */
public Rarity rank = Rarity.of(0);
/** gold paid */
public int gold;
/** drop table */
public String dropTable = "";
}
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Sides : B2
/** Neither key column is unique alone. */
class StageRewardRecord {
/** which stage */
var stage: Int = 0
/** finishing rank */
var rank: Rarity = Rarity.of(0)
/** gold paid */
var gold: Int = 0
/** drop table */
var dropTable: String = ""
}
-- Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Sides : B2.
-- Neither key column is unique alone.
---@class StageRewardRecord
---@field stage integer
---@field rank integer
---@field gold integer
---@field dropTable string
local StageRewardRecordMeta = tcb.strictType("a `StageReward` row", { "stage", "rank", "gold", "dropTable" })
/**
* Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Sides : B2
*
* Neither key column is unique alone.
*/
final class StageRewardRecord
{
/** which stage */
public int $stage = 0;
/** finishing rank */
public Rarity $rank = Rarity::None;
/** gold paid */
public int $gold = 0;
/** drop table */
public string $dropTable = '';
}
# Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Sides : B2
# Neither key column is unique alone.
class StageRewardRecord
attr_accessor :stage, :rank, :gold, :drop_table
def initialize
@stage = 0
@rank = 0
@gold = 0
@drop_table = ''
end
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Sides : B2
/// Neither key column is unique alone.
#[derive(Clone, Debug, Default)]
pub struct StageRewardRecord {
/// which stage
pub stage: i32,
/// finishing rank
pub rank: Rarity,
/// gold paid
pub gold: i32,
/// drop table
pub drop_table: String,
}
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Sides : B2
/// Neither key column is unique alone.
public final class StageRewardRecord {
public init() {}
/// which stage
public var stage: Int32 = 0
/// finishing rank
public var rank: Rarity = Rarity.of(0)
/// gold paid
public var gold: Int32 = 0
/// drop table
public var dropTable: String = ""
}
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Sides : B2
/** Neither key column is unique alone. */
USTRUCT(BlueprintType)
struct DOCSHOWCASE_API FStageRewardRow
{
GENERATED_BODY()
/** which stage */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "StageReward")
int32 Stage = 0;
/** finishing rank */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "StageReward")
ERarity Rank = static_cast<ERarity>(0);
/** gold paid */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "StageReward")
int32 Gold = 0;
/** drop table */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "StageReward")
FString DropTable;
};
키가 둘이면 조회 함수의 인자도 둘입니다 —
FindByStageAndRank(stage, rank) 처럼 성분마다 하나씩 생깁니다. 이름이 그 인덱스의 컬럼에서
만들어지므로, 키를 바꾸면 함수 이름이 함께 바뀌고 옛 이름을 부르던 자리가 컴파일에서
드러납니다.