public void AddUser(UserPlayState userPlayState, bool showScore, bool showEvaluate, bool showLife) { var playUserIcon = new PlayUserIcon(device, resourceManager, userPlayState, showScore, showEvaluate, showLife) { Position = new SharpDX.Vector2(0, ChildrenCount * ItemHeight) }; this.AddChild(playUserIcon); list.Add(playUserIcon); }
public void DeleteUser(UserPlayState userPlayState) { PlayUserIcon found = null; foreach (PlayUserIcon playUserIcon in Children) { if (playUserIcon.UserPlayState == userPlayState) { found = playUserIcon; break; } } if (found != null) { this.RemoveChild(found); list.Remove(found); } }
private int Compare(PlayUserIcon icon1, PlayUserIcon icon2) { int ret; if (icon1.DisplayScore == icon2.DisplayScore) { if (icon1.UserPlayState.User.IsSelf) { return(-1); } else if (icon2.UserPlayState.User.IsSelf) { return(1); } ret = String.Compare(icon1.UserPlayState.User.AccountId, icon2.UserPlayState.User.AccountId); } else { ret = icon1.DisplayScore - icon2.DisplayScore; } return(ret * -1); }