/** * 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, getSetDecoder, getSetEncoder, getStructDecoder, getStructEncoder, getU16Decoder, getU16Encoder, getU32Decoder, getU32Encoder, type Codec, type Decoder, type Encoder, } from '@solana/kit'; import { getBuildingTagDecoder, getBuildingTagEncoder, getCargoIdDecoder, getCargoIdEncoder, getNameDecoder, getNameEncoder, getTierDecoder, getTierEncoder, type BuildingTag, type BuildingTagArgs, type CargoId, type CargoIdArgs, type Name, type NameArgs, type Tier, type TierArgs, } from '.'; import { getU8F56Decoder, getU8F56Encoder, type U8F56, type U8F56Args, } from '../../fixed/codecs'; /** Crafting hab definition that specifies capabilities and requirements */ export type CraftingHabDefinition = { /** The human-readable name for this crafting hab. */ name: Name; /** The cargo type which is used to place the crafting hab */ cargoId: CargoId; /** The tier level of the crafting hab */ tier: Tier; /** Number of building slots available on the crafting hab */ slots: number; /** Multiplier for rent calculations */ rentMultiplier: U8F56; /** Multiplier for placement fees */ placementFeeMultiplier: U8F56; /** Value of hub type buildings which can be built */ hubValue: number; /** Tags required to place the crafting hab */ requiredTags: Set; /** Tags provided by the crafting hab for satisfying building requirements */ providedTags: Set; }; export type CraftingHabDefinitionArgs = { /** The human-readable name for this crafting hab. */ name: NameArgs; /** The cargo type which is used to place the crafting hab */ cargoId: CargoIdArgs; /** The tier level of the crafting hab */ tier: TierArgs; /** Number of building slots available on the crafting hab */ slots: number; /** Multiplier for rent calculations */ rentMultiplier: U8F56Args; /** Multiplier for placement fees */ placementFeeMultiplier: U8F56Args; /** Value of hub type buildings which can be built */ hubValue: number; /** Tags required to place the crafting hab */ requiredTags: Set; /** Tags provided by the crafting hab for satisfying building requirements */ providedTags: Set; }; export function getCraftingHabDefinitionEncoder(): Encoder { return getStructEncoder([ ['name', getNameEncoder()], ['cargoId', getCargoIdEncoder()], ['tier', getTierEncoder()], ['slots', getU32Encoder()], ['rentMultiplier', getU8F56Encoder()], ['placementFeeMultiplier', getU8F56Encoder()], ['hubValue', getU16Encoder()], ['requiredTags', getSetEncoder(getBuildingTagEncoder())], ['providedTags', getSetEncoder(getBuildingTagEncoder())], ]); } export function getCraftingHabDefinitionDecoder(): Decoder { return getStructDecoder([ ['name', getNameDecoder()], ['cargoId', getCargoIdDecoder()], ['tier', getTierDecoder()], ['slots', getU32Decoder()], ['rentMultiplier', getU8F56Decoder()], ['placementFeeMultiplier', getU8F56Decoder()], ['hubValue', getU16Decoder()], ['requiredTags', getSetDecoder(getBuildingTagDecoder())], ['providedTags', getSetDecoder(getBuildingTagDecoder())], ]); } export function getCraftingHabDefinitionCodec(): Codec< CraftingHabDefinitionArgs, CraftingHabDefinition > { return combineCodec( getCraftingHabDefinitionEncoder(), getCraftingHabDefinitionDecoder(), ); }