All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.daxie.xops.exe.XOPSExeWeaponDataWriter Maven / Gradle / Ivy

package com.daxie.xops.exe;

import java.util.List;

import com.daxie.basis.vector.Vector;
import com.daxie.log.LogFile;
import com.daxie.tool.ByteFunctions;
import com.daxie.xops.XOPSConstants;
import com.daxie.xops.weapon.WeaponBinSpecifierAndEnumConverter;
import com.daxie.xops.weapon.WeaponData;
import com.daxie.xops.weapon.WeaponModelFilenamesStock;
import com.daxie.xops.weapon.WeaponModelType;
import com.daxie.xops.weapon.WeaponScopeMode;
import com.daxie.xops.weapon.WeaponShootingStance;
import com.daxie.xops.weapon.WeaponTextureFilenamesStock;
import com.daxie.xops.weapon.WeaponTextureType;

/**
 * Writes data to an EXE file.
 * @author Daba
 *
 */
class XOPSExeWeaponDataWriter {
	private WeaponData[] weapon_data_array;
	
	public XOPSExeWeaponDataWriter(WeaponData[] weapon_data_array) {
		this.weapon_data_array=weapon_data_array;
	}
	
	public void Write(List bin,int weapon_data_start_pos,int weapon_name_start_pos) {
		if(weapon_data_array==null) {
			LogFile.WriteWarn("[XOPSExeWeaponDataWriter-Write] Data is null.",true);
			return;
		}
		if(weapon_data_array.length!=XOPSConstants.WEAPON_NUM) {
			LogFile.WriteWarn("[XOPSExeWeaponDataWriter-Write] Invalid number of data. data_num:"+weapon_data_array.length,true);
			return;
		}
		
		int pos=weapon_data_start_pos;
		
		for(int i=0;i=15)break;
				name_buffer[j]=(byte)name.charAt(j);
			}
			
			for(int j=0;j<16;j++) {
				bin.set(pos+j, name_buffer[j]);
			}
			pos+=16;
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy