A SpaceTraders Agent
at main 655 B view raw
1pub const Contract = struct { 2 id: []const u8, 3 factionSymbol: []const u8, 4 type: Type = .PROCUREMENT, 5 terms: Terms = .{}, 6 accepted: bool = false, 7 fullfilled: bool = false, 8 deadlineToAccept: []const u8, 9}; 10 11pub const Type = enum { 12 PROCUREMENT, 13 TRANSPORT, 14 SHUTTLE, 15}; 16 17pub const Terms = struct { 18 deadline: []const u8 = "", 19 payment: Payment = .{}, 20 deliver: []Deliver = &.{}, 21}; 22 23pub const Payment = struct { 24 onAccepted: u64 = 0, 25 onFulfilled: u64 = 0, 26}; 27 28pub const Deliver = struct { 29 tradeSymbol: []const u8, 30 destinationSymbol: []const u8, 31 unitsRequired: u64, 32 unitsFulfilled: u64, 33};