//------------------------------------------------------------------------------
//
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------
namespace G
{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
///
/// Generated from: kungfu.xlsx
///
public partial class ItemKungfuGroup
{
private List _kungfuItems;
public IList kungfuItems
{
get
{
if (_kungfuItems == null)
{
_kungfuItems = new List(kungfus.Length);
for (int i = 0; i < kungfus.Length; i++)
{
_kungfuItems.Add(ItemProxy.Instance.GetStaticItem(kungfus[i]));
}
}
return _kungfuItems;
}
}
public ItemKungfu GetRndStudy()
{
var items = kungfuItems;
int unmax = 0;
for (int i = 0; i < items.Count; i++)
{
if (!items[i].isMaxGrade)
{
unmax += 1;
}
}
if (unmax > 0)
{
int r = Random.Range(0, unmax);
for (int i = 0; i < items.Count; i++)
{
if (!items[i].isMaxGrade)
{
r -= 1;
if (r < 0)
{
return items[i];
}
}
}
}
return null;
}
public int curGrade
{
get
{
int result = 0;
foreach (var item in kungfuItems)
{
result += item.grade;
}
return result;
}
}
public int maxGrade
{
get
{
int result = 0;
foreach (var item in kungfuItems)
{
result += item.gradeMax;
}
return result;
}
}
public bool isMaxGrade
{
get
{
foreach (var item in kungfuItems)
{
if (!item.isMaxGrade)
return false;
}
return true;
}
}
static Item.ItemInfo[] _Costs = new ItemInfo[1];
static Item.ItemInfo[] _Costs2 = new ItemInfo[2];
public Item.ItemInfo[] curUpgradeCost
{
get
{
int grade = curGrade;
//if (KPlatform.Instance.IsAbConfig("ab_weight", "2"))
//{
// for (int i = 0; i < _Costs2.Length; i++)
// {
// _Costs2[i] = new Item.ItemInfo
// {
// id = upgradeCost2[i][0],
// count = upgradeCost2[i][1] + grade * upgradeCost2[i][2],
// };
// }
// return _Costs2;
//}
//else
//{
for (int i = 0; i < _Costs.Length; i++)
{
_Costs[i] = new Item.ItemInfo
{
id = upgradeCost[i][0],
count = upgradeCost[i][1] + grade * upgradeCost[i][2],
};
}
return _Costs;
//}
}
}
public Item.ItemInfo[] curUpgradeCost2
{
get
{
int grade = curGrade;
for (int i = 0; i < _Costs.Length; i++)
{
_Costs[i] = new Item.ItemInfo
{
id = upgradeCost2[i][0],
count = upgradeCost2[i][1] + grade * upgradeCost2[i][2],
};
}
return _Costs;
}
}
}
}