Files
2026-04-01 20:20:09 +09:00

68 lines
2.6 KiB
C#

using MongoDB.Bson;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LolDataRequestLib.ResponseData
{
class : IResponseData
{
public DataTable ()
{
DataTable = new DataTable(DBDefine...ToString());
try
{
.Columns.Add("팀");
//픽리스트테이블.Columns.Add("포지션");
.Columns.Add("선수닉네임");
.Columns.Add("챔피언이름");
.Columns.Add("총골드획득량");
.Columns.Add("보유골드량");
.Columns.Add("대비총골드퍼센트");
.Columns.Add("대비보유골드퍼센트");
if (DataManager.getInstance(). == null)
{
return ;
}
List<BsonValue> = DataManager.getInstance().["participants"].AsBsonArray.OrderByDescending(p => p["totalGold"].ToInt32()).ToList();
double maxGold = (double)[0]["totalGold"].ToInt32();
for (int i = 0; i < .Count(); i++)
{
BsonValue item = [i];
DataRow bufRow = .NewRow();
bufRow["팀"] = (DBDefine.)item["teamID"].ToInt32();
//bufRow["포지션"] = (DBDefine.라인구분)item["participantID"].AsInt32 + 1;
bufRow["선수닉네임"] = item["playerName"];
bufRow["챔피언이름"] = item["championName"];
bufRow["총골드획득량"] = item["totalGold"].ToInt32();
bufRow["보유골드량"] = item["currentGold"];
bufRow["대비총골드퍼센트"] = (item["totalGold"].ToInt32() / maxGold) * 100;
bufRow["대비보유골드퍼센트"] = (item["currentGold"].ToInt32() / maxGold) * 100;
.Rows.Add(bufRow);
}
}
catch (Exception ex) { }
return ;
}
}
}