本文整理汇总了C#中TitleInfo类的典型用法代码示例。如果您正苦于以下问题:C# TitleInfo类的具体用法?C# TitleInfo怎么用?C# TitleInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TitleInfo类属于命名空间,在下文中一共展示了TitleInfo类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ChampionTitleInfo
public ChampionTitleInfo(GenericReader reader)
{
int version = reader.ReadEncodedInt();
switch (version)
{
case 0:
{
m_Harrower = reader.ReadEncodedInt();
int length = reader.ReadEncodedInt();
m_Values = new TitleInfo[length];
for (int i = 0; i < length; i++)
{
m_Values[i] = new TitleInfo(reader);
}
if (m_Values.Length != ChampionSpawnInfo.Table.Length)
{
TitleInfo[] oldValues = m_Values;
m_Values = new TitleInfo[ChampionSpawnInfo.Table.Length];
for (int i = 0; i < m_Values.Length && i < oldValues.Length; i++)
{
m_Values[i] = oldValues[i];
}
}
break;
}
}
}
开发者ID:brodock,项目名称:genova-project,代码行数:32,代码来源:PlayerMobile.cs
示例2: Award
public void Award(int index, int value)
{
if (m_Values == null)
m_Values = new TitleInfo[ChampionSpawnInfo.Table.Length];
if (index < 0 || index >= m_Values.Length || value <= 0)
return;
if (m_Values[index] == null)
m_Values[index] = new TitleInfo();
m_Values[index].Value += value;
}
开发者ID:brodock,项目名称:genova-project,代码行数:13,代码来源:PlayerMobile.cs
示例3: Atrophy
public void Atrophy(int index, int value)
{
if (m_Values == null)
m_Values = new TitleInfo[ChampionSpawnInfo.Table.Length];
if (index < 0 || index >= m_Values.Length || value <= 0)
return;
if (m_Values[index] == null)
m_Values[index] = new TitleInfo();
int before = m_Values[index].Value;
if ((m_Values[index].Value - value) < 0)
m_Values[index].Value = 0;
else
m_Values[index].Value -= value;
if (before != m_Values[index].Value)
m_Values[index].LastDecay = DateTime.Now;
}
开发者ID:brodock,项目名称:genova-project,代码行数:21,代码来源:PlayerMobile.cs
示例4: GetLastDecay
public DateTime GetLastDecay(int index)
{
if (m_Values == null || index < 0 || index >= m_Values.Length)
return DateTime.MinValue;
if (m_Values[index] == null)
m_Values[index] = new TitleInfo();
return m_Values[index].LastDecay;
}
开发者ID:brodock,项目名称:genova-project,代码行数:10,代码来源:PlayerMobile.cs
示例5: SetValue
public void SetValue(int index, int value)
{
if (m_Values == null)
m_Values = new TitleInfo[ChampionSpawnInfo.Table.Length];
if (value < 0)
value = 0;
if (index < 0 || index >= m_Values.Length)
return;
if (m_Values[index] == null)
m_Values[index] = new TitleInfo();
m_Values[index].Value = value;
}
开发者ID:brodock,项目名称:genova-project,代码行数:16,代码来源:PlayerMobile.cs
示例6: GetValue
public int GetValue(int index)
{
if (m_Values == null || index < 0 || index >= m_Values.Length)
return 0;
if (m_Values[index] == null)
m_Values[index] = new TitleInfo();
return m_Values[index].Value;
}
开发者ID:brodock,项目名称:genova-project,代码行数:10,代码来源:PlayerMobile.cs
示例7: Serialize
public static void Serialize(GenericWriter writer, TitleInfo info)
{
writer.WriteEncodedInt((int)0); // version
writer.WriteEncodedInt(info.m_Value);
writer.Write(info.m_LastDecay);
}
开发者ID:brodock,项目名称:genova-project,代码行数:7,代码来源:PlayerMobile.cs
示例8: GetChapters
/// <summary>
/// Gets chapters from the given BDTitleInfo object
/// </summary>
/// <param name="titleInfo">BDTitleInfo object</param>
/// <returns>chapters as an array consisting of the start time in seconds</returns>
protected virtual double[] GetChapters(TitleInfo titleInfo)
{
double[] chapters = new double[titleInfo.native.chapter_count];
if (chapters.Length > 2) // only two chapters means beginning and end - no real chapters
{
for (int i = 0; i < chapters.Length; i++)
{
unsafe
{
double s = titleInfo.native.chapters[i].start/90000;
chapters[i] = s;
TimeSpan ts = TimeSpan.FromSeconds(s);
Log.Debug("BDPlayer: Chapter info #{0}: start time: {1}", titleInfo.native.chapters[i].idx,
String.Format("{0:D2}:{1:D2}:{2:D2}", ts.Hours, ts.Minutes, ts.Seconds));
}
}
if (chapters[chapters.Length - 1] < 300) // 5 min sanity check
chapters = null;
}
else
chapters = null;
return chapters;
}
开发者ID:Erls-Corporation,项目名称:MediaPortal-1,代码行数:30,代码来源:BDPlayer.cs
示例9: GetTitleInfo
/// <summary>
/// Gets the title info for the specified index
/// </summary>
/// <param name="reader">IBDReader object</param>
/// <param name="index">index of the title</param>
/// <returns></returns>
protected virtual TitleInfo GetTitleInfo(IBDReader reader, int index)
{
TitleInfo titleInfo = new TitleInfo(reader, index);
return titleInfo;
}
开发者ID:Erls-Corporation,项目名称:MediaPortal-1,代码行数:11,代码来源:BDPlayer.cs
示例10: ReadTitlesFile
private Task ReadTitlesFile()
{
return Task.Run(() =>
{
_logger.Debug("Loading AniDB titles");
var titlesFile = _downloader.TitlesFilePath;
var settings = new XmlReaderSettings
{
CheckCharacters = false,
IgnoreProcessingInstructions = true,
IgnoreComments = true,
ValidationType = ValidationType.None
};
using (var stream = new StreamReader(titlesFile, Encoding.UTF8))
using (var reader = XmlReader.Create(stream, settings))
{
string aid = null;
while (reader.Read())
{
if (reader.NodeType == XmlNodeType.Element)
{
switch (reader.Name)
{
case "anime":
reader.MoveToAttribute("aid");
aid = reader.Value;
break;
case "title":
var title = reader.ReadElementContentAsString();
if (!string.IsNullOrEmpty(aid) && !string.IsNullOrEmpty(title))
{
var type = ParseType(reader.GetAttribute("type"));
TitleInfo currentTitleInfo;
if (!_titles.TryGetValue(title, out currentTitleInfo) || (int)currentTitleInfo.Type < (int)type)
{
_titles[title] = new TitleInfo {AniDbId = aid, Type = type};
}
}
break;
}
}
}
}
var comparable = (from pair in _titles
let comp = GetComparableName(pair.Key)
where !_titles.ContainsKey(comp)
select new {Title = comp, Id = pair.Value})
.ToArray();
foreach (var pair in comparable)
{
_titles[pair.Title] = pair.Id;
}
});
}
开发者ID:purposelycryptic,项目名称:MediaBrowser.Plugins.Anime,代码行数:61,代码来源:AniDbTitleMatcher.cs
注:本文中的TitleInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论