本文整理汇总了C#中Ship.Select方法的典型用法代码示例。如果您正苦于以下问题:C# Ship.Select方法的具体用法?C# Ship.Select怎么用?C# Ship.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ship
的用法示例。
在下文中一共展示了Ship.Select方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
internal void Update(Ship[] s)
{
if (s.Length == 0)
{
this.RepairingDock = null;
return;
}
var shipIds = s.Select(x => x.Id).ToArray();
var repairyards = KanColleClient.Current.Homeport.Repairyard.Docks.Values.Where(x => x.Ship != null)
.Where(x => shipIds.Any(X => X == x.ShipId));
this.RepairingDock = repairyards.Any() ? repairyards.OrderByDescending(x => x.Remaining).First() : null;
}
示例2: Calc
public override double Calc(Ship[] ships)
{
if (ships == null || ships.Length == 0) return 0;
// http://wikiwiki.jp/kancolle/?%C6%EE%C0%BE%BD%F4%C5%E7%B3%A4%B0%E8#search-calc
// > 2-5式では説明出来ない事象を解決するため膨大な検証報告数より導き出した新式。2014年11月に改良され精度があがった。
// > 索敵スコア
// > = 艦上爆撃機 × (1.04)
// > + 艦上攻撃機 × (1.37)
// > + 艦上偵察機 × (1.66)
// > + 水上偵察機 × (2.00)
// > + 水上爆撃機 × (1.78)
// > + 小型電探 × (1.00)
// > + 大型電探 × (.99)
// > + 探照灯 × (0.91)
// > + √(各艦毎の素索敵) × (1.69)
// > + (司令部レベルを5の倍数に切り上げ) × (-0.61)
var itemScore = ships
.SelectMany(x => x.EquippedItems)
.Select(x => x.Item.Info)
.GroupBy(
x => x.Type,
x => x.RawData.api_saku,
(type, scores) => new { type, score = scores.Sum() })
.Aggregate(.0, (score, item) => score + GetScore(item.type, item.score));
var shipScore = ships
.Select(x => x.ViewRange - x.EquippedItems.Sum(s => s.Item.Info.RawData.api_saku))
.Select(x => Math.Sqrt(x))
.Sum() * 1.69;
var level = (((KanColleClient.Current.Homeport.Admiral.Level + 4) / 5) * 5);
var admiralScore = level * -0.61;
return itemScore + shipScore + admiralScore;
}
示例3: Calc
public override double Calc(Ship[] ships)
{
if (ships == null || ships.Length == 0) return 0;
// http://wikiwiki.jp/kancolle/?%C6%EE%C0%BE%BD%F4%C5%E7%B3%A4%B0%E8#area5
// 2-5 詳細2
var itemScore = ships
.SelectMany(x => x.EquippedSlots)
.Select(x => x.Item.Info)
.GroupBy(
x => x.Type,
x => x.RawData.api_saku,
(type, scores) => new { type, score = scores.Sum() })
.Aggregate(.0, (score, item) => score + GetScore(item.type, item.score));
var shipScore = ships
.Select(x => x.ViewRange - x.EquippedSlots.Sum(s => s.Item.Info.RawData.api_saku))
.Select(x => Math.Sqrt(x))
.Sum();
//var level = (((KanColleClient.Current.Homeport.Admiral.Level + 4) / 5) * 5);
var admiralScore = KanColleClient.Current.Homeport.Admiral.Level * -0.36;
return itemScore + shipScore + admiralScore;
}