本文整理汇总了C#中Actor.ToList方法的典型用法代码示例。如果您正苦于以下问题:C# Actor.ToList方法的具体用法?C# Actor.ToList怎么用?C# Actor.ToList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Actor
的用法示例。
在下文中一共展示了Actor.ToList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnAllKilled
public void OnAllKilled(Actor[] actors, LuaFunction func)
{
var group = actors.ToList();
var copy = (LuaFunction)func.CopyReference();
Action<Actor> onMemberKilled = m =>
{
try
{
group.Remove(m);
if (!group.Any())
{
copy.Call();
copy.Dispose();
}
}
catch (Exception e)
{
Context.FatalError(e.Message);
}
};
foreach (var a in group)
GetScriptTriggers(a).OnKilledInternal += onMemberKilled;
}
示例2: OnAllRemovedFromWorld
public void OnAllRemovedFromWorld(Actor[] actors, LuaFunction func)
{
var group = actors.ToList();
var f = (LuaFunction)func.CopyReference();
Action<Actor> onMemberRemoved = m =>
{
try
{
if (!group.Remove(m))
return;
if (!group.Any())
using (f)
f.Call().Dispose();
}
catch (Exception e)
{
Context.FatalError(e.Message);
}
};
foreach (var a in group)
GetScriptTriggers(a).OnRemovedInternal += onMemberRemoved;
}
示例3: refreshPlayersList
public void refreshPlayersList(Actor[] actors)
{
PlayerList.Items.Clear();
Players = actors.ToList();
balancelist.Items.Clear();
foreach (Actor item in actors)
{
PlayerList.Items.Add(item.Name);
balancelist.Items.Add(item.Money);
PictureBox pictureBox = new PictureBox();
playerTokens[item.PlayerID].Location = pictureBoxes[item.Location].Location;
if (proxy.username == item.Name)
{
usernamelb.Text = item.Name;
balancelb.Text = item.Money.ToString();
}
}
}