/** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ import { combineCodec, getBooleanDecoder, getBooleanEncoder, getI64Decoder, getI64Encoder, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, type Codec, type Decoder, type Encoder, } from '@solana/kit'; import { getI8F56Decoder, getI8F56Encoder, getU0F32Decoder, getU0F32Encoder, getU26F6Decoder, getU26F6Encoder, type I8F56, type I8F56Args, type U0F32, type U0F32Args, type U26F6, type U26F6Args, } from '../../fixed/codecs'; /** Combat Config */ export type CombatConfig = { /** global ceasefire */ globalCeasefire: boolean; /** The range at which ships can interact */ interactionRange: I8F56; /** amount of time when the last-hitter of a fleet will have exclusive access to loot */ lootExclusivityTime: bigint; /** the max loot rate */ maxLootRate: U26F6; /** percentage of a starbase upgrade that's kept when a level 0 starbase is destroyed */ starbaseUpgradeProgressContinuation: U0F32; /** Time taken for crew to respawn when a starbase is destroyed */ crewRespawnTime: bigint; /** Time taken for cargo to respawn when a starbase is destroyed */ cargoRespawnTime: bigint; /** Time taken for individual ships to respawn when a starbase is destroyed */ rawShipsRespawnTime: bigint; /** The max number of ships in a fleet */ maxFleetSize: number; }; export type CombatConfigArgs = { /** global ceasefire */ globalCeasefire: boolean; /** The range at which ships can interact */ interactionRange: I8F56Args; /** amount of time when the last-hitter of a fleet will have exclusive access to loot */ lootExclusivityTime: number | bigint; /** the max loot rate */ maxLootRate: U26F6Args; /** percentage of a starbase upgrade that's kept when a level 0 starbase is destroyed */ starbaseUpgradeProgressContinuation: U0F32Args; /** Time taken for crew to respawn when a starbase is destroyed */ crewRespawnTime: number | bigint; /** Time taken for cargo to respawn when a starbase is destroyed */ cargoRespawnTime: number | bigint; /** Time taken for individual ships to respawn when a starbase is destroyed */ rawShipsRespawnTime: number | bigint; /** The max number of ships in a fleet */ maxFleetSize: number; }; export function getCombatConfigEncoder(): Encoder { return getStructEncoder([ ['globalCeasefire', getBooleanEncoder()], ['interactionRange', getI8F56Encoder()], ['lootExclusivityTime', getI64Encoder()], ['maxLootRate', getU26F6Encoder()], ['starbaseUpgradeProgressContinuation', getU0F32Encoder()], ['crewRespawnTime', getI64Encoder()], ['cargoRespawnTime', getI64Encoder()], ['rawShipsRespawnTime', getI64Encoder()], ['maxFleetSize', getU32Encoder()], ]); } export function getCombatConfigDecoder(): Decoder { return getStructDecoder([ ['globalCeasefire', getBooleanDecoder()], ['interactionRange', getI8F56Decoder()], ['lootExclusivityTime', getI64Decoder()], ['maxLootRate', getU26F6Decoder()], ['starbaseUpgradeProgressContinuation', getU0F32Decoder()], ['crewRespawnTime', getI64Decoder()], ['cargoRespawnTime', getI64Decoder()], ['rawShipsRespawnTime', getI64Decoder()], ['maxFleetSize', getU32Decoder()], ]); } export function getCombatConfigCodec(): Codec { return combineCodec(getCombatConfigEncoder(), getCombatConfigDecoder()); }