本文整理汇总了C#中Data.List.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# List.Remove方法的具体用法?C# List.Remove怎么用?C# List.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Data.List
的用法示例。
在下文中一共展示了List.Remove方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetFarFromOneRelations
public static List<UserProfile> GetFarFromOneRelations(Guid userId)
{
// On cherche nos relations. On cherche les relations de nos relations => récursif
List<UserProfile> listUserRelations = GetRelations(userId);
List<UserProfile> listLoggedUserRelation = GetRelations((Guid)(Membership.GetUser(System.Web.HttpContext.Current.User.Identity.Name, false).ProviderUserKey));
List<UserProfile> listFarFromOneRelations = new List<UserProfile>();
// We search all the directly connected users to the actual logged user relations
foreach (UserProfile userRelation in listUserRelations)
{
listFarFromOneRelations.AddRange(GetRelations((Guid)(Membership.GetUser(userRelation.UserName, false).ProviderUserKey)));
}
UserProfile actualUser = UserProfile.GetUserProfile(System.Web.HttpContext.Current.User.Identity.Name);
while(listFarFromOneRelations.Contains(actualUser))
{
// We delete all the occurences of the actual user
listFarFromOneRelations.Remove(actualUser);
}
// On supprime les utilisateurs qui sont déjà directement connectés avec l'utilisateur
foreach (UserProfile user in listLoggedUserRelation)
{
if (listFarFromOneRelations.Contains(user))
{
listFarFromOneRelations.Remove(user);
}
}
return listFarFromOneRelations;
}
示例2: znajdzDrogePowrotnaRek
//.........这里部分代码省略.........
if (overalCost > temp[0])
{
overalCost = temp[0];
firstStep = temp[1];
}
}
}
nextStep = ZnanaMapa.znajdzPole(x, y + 1);
if (nextStep != null)
if (!((nextStep.getPrzeszkoda()) || (nextStep.getUnrechable())))
{
int nextKier = 2;
int[] temp = new int[2];
temp[0] = upCost;
if (!before.Exists(delegate(Wspolrzedne w)
{
if ((w.x == x) && (w.y == y + 1))
return true;
else
return false;
}))
{
if (before.Count > 1)
{
ZbadanePole tuStoje = ZnanaMapa.znajdzPole(x, y);
int nowaWysokosc = nextStep.getWysokosc();
temp[0] += cennikSwiata.moveCost;
temp[0] += Convert.ToInt32(Math.Ceiling(Convert.ToDouble
(cennikSwiata.moveCost * (nowaWysokosc - tuStoje
.getWysokosc())) / 100));
if ((lastKier == 1) || (lastKier == 3))
temp[0] += cennikSwiata.rotateCost;
if (lastKier == 2)
temp[0] += cennikSwiata.rotateCost * 2;
}
temp = znajdzDrogePowrotnaRek(x, y + 1, nextKier, before, temp[0], limit);
if (overalCost > temp[0])
{
overalCost = temp[0];
firstStep = temp[1];
}
}
}
}
nextStep = ZnanaMapa.znajdzPole(x + 1, y);
if (nextStep != null)
if (!((nextStep.getPrzeszkoda()) || (nextStep.getUnrechable())))
{
int nextKier = 3;
int[] temp = new int[2];
temp[0] = upCost;
if (!before.Exists(delegate(Wspolrzedne w)
{
if ((w.x == x + 1) && (w.y == y))
return true;
else
return false;
}))
{
if (before.Count > 1)
{
ZbadanePole tuStoje = ZnanaMapa.znajdzPole(x, y);
int nowaWysokosc = nextStep.getWysokosc();
temp[0] += cennikSwiata.moveCost;
temp[0] += Convert.ToInt32(Math.Ceiling(Convert.ToDouble
(cennikSwiata.moveCost * (nowaWysokosc - tuStoje
.getWysokosc())) / 100));
if ((lastKier == 0) || (lastKier == 2))
temp[0] += cennikSwiata.rotateCost;
if (lastKier == 1)
temp[0] += cennikSwiata.rotateCost * 2;
}
temp = znajdzDrogePowrotnaRek(x + 1, y, nextKier, before, temp[0], limit);
if (overalCost > temp[0])
{
overalCost = temp[0];
firstStep = temp[1];
}
}
}
}
#endregion
before.Remove(
before.Find(delegate(Wspolrzedne w)
{
if ((w.x == x) && (w.y == y))
return true;
else
return false;
})
);
int[] zwrot = new int[2];
zwrot[0] = overalCost;
zwrot[1] = firstStep;
return zwrot;
}
示例3: BreakTies
protected override void BreakTies(List<Player> tiedPlayers)
{
tiedPlayers.Remove(tiedPlayers.SingleOrDefault(p => p.Role != null && p.Role.GetType() == typeof(BlackjackDealerRole)));
}