36 lines
864 B
C#
36 lines
864 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using XPlugin.Data.JsonLiteDB;
|
|
|
|
public class RoundInfo
|
|
{
|
|
public int ID;
|
|
public int Belong;
|
|
public List<int> EnemyList;
|
|
|
|
public RoundInfo(JsonLiteDB.TableReader table)
|
|
{
|
|
ID = table["ID"].OptInt();
|
|
Belong = table["Belong"].OptInt();
|
|
EnemyList = new List<int>();
|
|
string enemyStr = table["EnemyTypes"].OptString();
|
|
EnemyList = ParseStringToIntArray(enemyStr);
|
|
}
|
|
List<int> ParseStringToIntArray(string input)
|
|
{
|
|
if (input == "")
|
|
{
|
|
return null;
|
|
}
|
|
string[] elements = input.Replace("[", "").Replace("]", "").Split(',');
|
|
List<int> intArray = new List<int>();
|
|
|
|
for (int i = 0; i < elements.Length; i++)
|
|
{
|
|
intArray.Add(int.Parse(elements[i]));
|
|
}
|
|
return intArray;
|
|
}
|
|
}
|