/** * 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, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, getU8Decoder, getU8Encoder, type Codec, type Decoder, type Encoder, } from '@solana/kit'; import { getI8F56Decoder, getI8F56Encoder, getU16F16Decoder, getU16F16Encoder, type I8F56, type I8F56Args, type U16F16, type U16F16Args, } from '../../fixed/codecs'; export type ScanNoiseMap = { noiseMapType: number; noisePowerFunction: number; xMultiplier: U16F16; yMultiplier: U16F16; zMultiplier: U16F16; xCenter: I8F56; yCenter: I8F56; originMaxDistance: I8F56; /** Weights are added together then multiplied by the fleet's scan bonus to get the final result. */ weight: U16F16; /** An offset to the global seed, should be different for each noise map in a pattern. */ seedOffset: number; }; export type ScanNoiseMapArgs = { noiseMapType: number; noisePowerFunction: number; xMultiplier: U16F16Args; yMultiplier: U16F16Args; zMultiplier: U16F16Args; xCenter: I8F56Args; yCenter: I8F56Args; originMaxDistance: I8F56Args; /** Weights are added together then multiplied by the fleet's scan bonus to get the final result. */ weight: U16F16Args; /** An offset to the global seed, should be different for each noise map in a pattern. */ seedOffset: number; }; export function getScanNoiseMapEncoder(): Encoder { return getStructEncoder([ ['noiseMapType', getU8Encoder()], ['noisePowerFunction', getU8Encoder()], ['xMultiplier', getU16F16Encoder()], ['yMultiplier', getU16F16Encoder()], ['zMultiplier', getU16F16Encoder()], ['xCenter', getI8F56Encoder()], ['yCenter', getI8F56Encoder()], ['originMaxDistance', getI8F56Encoder()], ['weight', getU16F16Encoder()], ['seedOffset', getU32Encoder()], ]); } export function getScanNoiseMapDecoder(): Decoder { return getStructDecoder([ ['noiseMapType', getU8Decoder()], ['noisePowerFunction', getU8Decoder()], ['xMultiplier', getU16F16Decoder()], ['yMultiplier', getU16F16Decoder()], ['zMultiplier', getU16F16Decoder()], ['xCenter', getI8F56Decoder()], ['yCenter', getI8F56Decoder()], ['originMaxDistance', getI8F56Decoder()], ['weight', getU16F16Decoder()], ['seedOffset', getU32Decoder()], ]); } export function getScanNoiseMapCodec(): Codec { return combineCodec(getScanNoiseMapEncoder(), getScanNoiseMapDecoder()); }