120 lines
3.4 KiB
C#
120 lines
3.4 KiB
C#
|
//This code create by CodeEngine ,don't modify
|
||
|
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Collections;
|
||
|
using Module.Log;
|
||
|
|
||
|
namespace GCGame.Table
|
||
|
{
|
||
|
|
||
|
public class Tab_CharMount{
|
||
|
|
||
|
public const string TAB_FILE_DATA = "CharMount";
|
||
|
private const int _varCount = 19;
|
||
|
|
||
|
public int GetId()
|
||
|
{
|
||
|
return Id;
|
||
|
}
|
||
|
|
||
|
public static bool Validate(string line)
|
||
|
{
|
||
|
var segments = 0;
|
||
|
foreach (char c in line)
|
||
|
if (c == '\t')
|
||
|
segments++;
|
||
|
// Note: skip the 2nd column as it's the description;
|
||
|
var result = segments == _varCount;
|
||
|
if (!result)
|
||
|
LogModule.ErrorLog(string.Format("Load {0} error as CodeSize:{1} not Equal DataSize:{2}", TAB_FILE_DATA, _varCount, segments));
|
||
|
return result;
|
||
|
}
|
||
|
|
||
|
public Tab_CharMount()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
public Tab_CharMount(string line)
|
||
|
{
|
||
|
var segments = line.Split('\t');
|
||
|
Id = int.Parse(segments[0]);
|
||
|
MountModel = segments[2].Trim();
|
||
|
SoundID = short.Parse(segments[3]);
|
||
|
BindPoint[0] = segments[4].Trim();
|
||
|
BindPoint[1] = segments[13].Trim();
|
||
|
HeadInfoAddHeight[0] = float.Parse(segments[5]);
|
||
|
HeadInfoAddHeight[1] = float.Parse(segments[6]);
|
||
|
HeadInfoAddHeight[2] = float.Parse(segments[7]);
|
||
|
HeadInfoAddHeight[3] = float.Parse(segments[8]);
|
||
|
IdlePlayerAnimationId[0] = int.Parse(segments[9]);
|
||
|
IdlePlayerAnimationId[1] = int.Parse(segments[18]);
|
||
|
RunPlayerAnimationId[0] = int.Parse(segments[10]);
|
||
|
RunPlayerAnimationId[1] = int.Parse(segments[19]);
|
||
|
BodyPos = segments[11].Trim();
|
||
|
BodyRot = segments[12].Trim();
|
||
|
HeadInfot[0] = float.Parse(segments[14]);
|
||
|
HeadInfot[1] = float.Parse(segments[15]);
|
||
|
HeadInfot[2] = float.Parse(segments[16]);
|
||
|
HeadInfot[3] = float.Parse(segments[17]);
|
||
|
|
||
|
}
|
||
|
|
||
|
public int Id { get; private set; }
|
||
|
|
||
|
public string MountModel { get; private set; }
|
||
|
|
||
|
public short SoundID { get; private set; }
|
||
|
|
||
|
public readonly string[] BindPoint = new string[2];
|
||
|
public int getBindPointCount() { return BindPoint.Length; }
|
||
|
public string GetBindPointbyIndex(int idx)
|
||
|
{
|
||
|
if(idx >= 0 && idx < BindPoint.Length)
|
||
|
return BindPoint[idx];
|
||
|
return default(string);
|
||
|
}
|
||
|
|
||
|
public readonly float[] HeadInfoAddHeight = new float[4];
|
||
|
public int getHeadInfoAddHeightCount() { return HeadInfoAddHeight.Length; }
|
||
|
public float GetHeadInfoAddHeightbyIndex(int idx)
|
||
|
{
|
||
|
if(idx >= 0 && idx < HeadInfoAddHeight.Length)
|
||
|
return HeadInfoAddHeight[idx];
|
||
|
return default(float);
|
||
|
}
|
||
|
|
||
|
public readonly int[] IdlePlayerAnimationId = new int[2];
|
||
|
public int getIdlePlayerAnimationIdCount() { return IdlePlayerAnimationId.Length; }
|
||
|
public int GetIdlePlayerAnimationIdbyIndex(int idx)
|
||
|
{
|
||
|
if(idx >= 0 && idx < IdlePlayerAnimationId.Length)
|
||
|
return IdlePlayerAnimationId[idx];
|
||
|
return default(int);
|
||
|
}
|
||
|
|
||
|
public readonly int[] RunPlayerAnimationId = new int[2];
|
||
|
public int getRunPlayerAnimationIdCount() { return RunPlayerAnimationId.Length; }
|
||
|
public int GetRunPlayerAnimationIdbyIndex(int idx)
|
||
|
{
|
||
|
if(idx >= 0 && idx < RunPlayerAnimationId.Length)
|
||
|
return RunPlayerAnimationId[idx];
|
||
|
return default(int);
|
||
|
}
|
||
|
|
||
|
public string BodyPos { get; private set; }
|
||
|
|
||
|
public string BodyRot { get; private set; }
|
||
|
|
||
|
public readonly float[] HeadInfot = new float[4];
|
||
|
public int getHeadInfotCount() { return HeadInfot.Length; }
|
||
|
public float GetHeadInfotbyIndex(int idx)
|
||
|
{
|
||
|
if(idx >= 0 && idx < HeadInfot.Length)
|
||
|
return HeadInfot[idx];
|
||
|
return default(float);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|