156 lines
2.6 KiB
C#
Raw Normal View History

2025-05-18 01:04:31 +08:00
// ***********************************************************************
// Assembly : Game
// Author : Kimch
// Created : 2021-06-28
// Description :
// Last Modified By :
// Last Modified On :
// ***********************************************************************
// <copyright file= "JobProxy" company="Kunpo"></copyright>
// <summary></summary>
// ***********************************************************************
using System.Collections;
using System.Collections.Generic;
using CodeStage.AntiCheat.ObscuredTypes;
using UnityEngine;
namespace G
{
/// <summary>
/// 职业
/// </summary>
public class JobProxy : F.GameProxy
{
#region
public class JobInfo
{
public readonly ItemChaJob item;
ObscuredInt _curValue;
public int curValue
{
get => _curValue;
set => _curValue = value;
}
public int maxValue => 100;
public int maxLevel => 10;
public int curLevelExpMax => 1000;
public int curLevelExp => 1;
public int curLevel => 1;
public JobInfo(ItemChaJob jobItem)
{
item = jobItem;
}
}
#endregion
#region Field
#endregion
#region Method
private const int MAX_JOB_ID = 5;
private readonly ObscuredInt[] _jobs = new ObscuredInt[MAX_JOB_ID + 1];
void LoadJobs()
{
var dataList = ArchiveProxy.Instance.GetIntList("jobs");
if (dataList != null && dataList.Count > 0)
{
for (int i = 0; i < dataList.Count; i++)
{
_jobs[i] = dataList[i];
}
}
}
void SaveJobs()
{
var dataList = ArchiveProxy.Instance.GetIntList("jobs");
if (dataList != null)
{
dataList.Clear();
dataList.AddRange(_jobs);
}
}
/// <summary>
///
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public int GetJob(int id)
{
return _jobs[id];
}
/// <summary>
///
/// </summary>
/// <param name="id"></param>
/// <param name="value"></param>
public void SetJob(int id, int value)
{
if (_jobs[id] != value)
{
_jobs[id] = value;
}
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public int GetTotalJob()
{
return _jobs[0];
}
public int job1
{
get { return _jobs[1]; }
}
public int job2
{
get { return _jobs[2]; }
}
public int job3
{
get { return _jobs[3]; }
}
public int job4
{
get { return _jobs[4]; }
}
public int job5
{
get { return _jobs[5]; }
}
#endregion
#region Proxy
public static JobProxy Instance => GetInstance<JobProxy>();
public override void ReadArchive()
{
}
#endregion
}
}