mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 17:00:02 +00:00
Fixes spelling mistake in the word position (#8330)
This commit is contained in:
@@ -112,7 +112,7 @@ public struct Vec3: NativeStruct, Verifiable, FlatbuffersInitializable {
|
||||
_z = _accessor.readBuffer(of: Float32.self, at: 8)
|
||||
_test1 = _accessor.readBuffer(of: Double.self, at: 16)
|
||||
_test2 = _accessor.readBuffer(of: UInt8.self, at: 24)
|
||||
_test3 = Test(_accessor.bb, o: _accessor.postion + 26)
|
||||
_test3 = Test(_accessor.bb, o: _accessor.position + 26)
|
||||
}
|
||||
|
||||
public init(x: Float32, y: Float32, z: Float32, test1: Double, test2: Color, test3: Test) {
|
||||
@@ -189,7 +189,7 @@ public struct Vec3_Mutable: FlatBufferObject {
|
||||
public var z: Float32 { return _accessor.readBuffer(of: Float32.self, at: 8) }
|
||||
public var test1: Double { return _accessor.readBuffer(of: Double.self, at: 16) }
|
||||
public var test2: Color { return Color(rawValue: _accessor.readBuffer(of: UInt8.self, at: 24)) ?? .red }
|
||||
public var test3: Test_Mutable { return Test_Mutable(_accessor.bb, o: _accessor.postion + 26) }
|
||||
public var test3: Test_Mutable { return Test_Mutable(_accessor.bb, o: _accessor.position + 26) }
|
||||
}
|
||||
|
||||
/// an example documentation comment: "monster object"
|
||||
@@ -199,8 +199,6 @@ public struct Monster: FlatBufferObject, Verifiable {
|
||||
public var __buffer: ByteBuffer! { return _accessor.bb }
|
||||
private var _accessor: Table
|
||||
|
||||
public static func getRootAsMonster(bb: ByteBuffer) -> Monster { return Monster(Table(bb: bb, position: Int32(bb.read(def: UOffset.self, position: bb.reader)) + Int32(bb.reader))) }
|
||||
|
||||
private init(_ t: Table) { _accessor = t }
|
||||
public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) }
|
||||
|
||||
@@ -217,7 +215,7 @@ public struct Monster: FlatBufferObject, Verifiable {
|
||||
}
|
||||
|
||||
public var pos: Vec3? { let o = _accessor.offset(VTOFFSET.pos.v); return o == 0 ? nil : _accessor.readBuffer(of: Vec3.self, at: o) }
|
||||
public var mutablePos: Vec3_Mutable? { let o = _accessor.offset(VTOFFSET.pos.v); return o == 0 ? nil : Vec3_Mutable(_accessor.bb, o: o + _accessor.postion) }
|
||||
public var mutablePos: Vec3_Mutable? { let o = _accessor.offset(VTOFFSET.pos.v); return o == 0 ? nil : Vec3_Mutable(_accessor.bb, o: o + _accessor.position) }
|
||||
public var mana: Int16 { let o = _accessor.offset(VTOFFSET.mana.v); return o == 0 ? 150 : _accessor.readBuffer(of: Int16.self, at: o) }
|
||||
public var hp: Int16 { let o = _accessor.offset(VTOFFSET.hp.v); return o == 0 ? 100 : _accessor.readBuffer(of: Int16.self, at: o) }
|
||||
public var name: String! { let o = _accessor.offset(VTOFFSET.name.v); return _accessor.string(at: o) }
|
||||
|
||||
Reference in New Issue
Block a user