You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.0 KiB

using System.Collections.Generic;
namespace ET
{
[FriendClass(typeof(Fighter))]
public class FighterComponentAwakeSystem:AwakeSystem<FighterComponent,Dictionary<int,People>>
{
public override void Awake(FighterComponent self, Dictionary<int,People> peopleDic)
{
foreach (var v in peopleDic.Keys)
{
var people = peopleDic[v];
var fighter = self.AddChildWithId<Fighter>(people.Id);
self.FighterDic[v] = fighter;
fighter.FromPeople(people);
fighter.Pos = v;
}
}
}
[FriendClass(typeof(Fighter))]
public static class FighterComponentSystem
{
public static bool IsFail(this FighterComponent self)
{
foreach (var v in self.Children.Values)
{
if (((Fighter) v).IsAlive)
{
return false;
}
}
return true;
}
}
}