本文整理汇总了C#中ICharacter.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ICharacter.ToString方法的具体用法?C# ICharacter.ToString怎么用?C# ICharacter.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICharacter
的用法示例。
在下文中一共展示了ICharacter.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToStringModelView
public static void ToStringModelView(ICharacter c, int nest, StringBuilder sb, out bool oneLiner)
{
if (c is Sprite)
{
((Sprite)c).ToStringModelView(nest, sb, out oneLiner);
}
else if (c is EditText)
{
((EditText)c).ToStringModelView(nest, sb, out oneLiner);
}
else if (c is StaticText)
{
((StaticText)c).ToStringModelView(nest, sb, out oneLiner);
}
else if (c is IImage)
{
((IImage)c).ToStringModelView(nest, sb, out oneLiner);
}
else if (c is IShape)
{
((IShape)c).ToStringModelView(nest, sb, out oneLiner);
}
else
{
throw new Exception("*** ERROR: CAN'T DUMP: " + c.ToString());
}
}
示例2: InitializeGameCommand
private void InitializeGameCommand(string command)
{
playerCharacter = InitializeCharacter(command);
Console.WriteLine(playerCharacter.ToString());
enemyUnits = InitializeEnemyUnits(enemyUnits);
var easiestEnemy = SortEasiestEnemy(enemyUnits);
Console.WriteLine(easiestEnemy.ToString());
HandleBattle(playerCharacter,easiestEnemy);
}
示例3: GetCharacterClass
private static string GetCharacterClass(ICharacter character)
{
string[] characterMeta = character.ToString().Split('.');
return characterMeta[characterMeta.Length - 1];
}
示例4: RefreshCharacterTraits
public static void RefreshCharacterTraits(ICharacter character, IMap map, PacketHitList hitlist, bool forme, bool sprite, bool type, bool ability,
bool atkSpeed, bool confusion, bool speedLimit, bool mobility, bool visibility, bool darkness, bool swapLock, bool moves, bool extraStatus)
{
int point = 0;
PacketHitList.MethodStart(ref hitlist);
try {
if (forme) {
RefreshCharacterForme(character, map, hitlist);
sprite = true;
type = true;
ability = true;
}
if (sprite) {
RefreshCharacterSprite(character, map, hitlist);
}
if (type) {
RefreshCharacterType(character, map, hitlist);
atkSpeed = true;
speedLimit = true;
mobility = true;
}
point = 1;
if (ability) {
RefreshCharacterAbility(character, map, hitlist);
atkSpeed = true;
confusion = true;
speedLimit = true;
mobility = true;
darkness = true;
}
point = 2;
RefreshCharacterAttackSpeed(character, map, hitlist);
point = 3;
RefreshCharacterConfusion(character, map, hitlist);
point = 4;
RefreshCharacterSpeedLimit(character, map, hitlist);
point = 5;
RefreshCharacterMobility(character, map, hitlist);
point = 6;
RefreshCharacterVisibility(character, map, hitlist);
point = 7;
RefreshCharacterDarkness(character, map, hitlist);
point = 8;
RefreshCharacterSwapLock(character, map, hitlist);
point = 9;
RefreshCharacterMoves(character, map, hitlist);
point = 10;
RefreshCharacterVolatileStatus(character, map, hitlist);
} catch (Exception ex) {
Messenger.AdminMsg("Error: RefreshCharacterTraits", Text.Black);
Messenger.AdminMsg(ex.ToString(), Text.Black);
Messenger.AdminMsg(point.ToString(), Text.Black);
Messenger.AdminMsg(character.ToString(), Text.Black);
Messenger.AdminMsg("Species #" + character.Species + ", Form #" + character.Form, Text.Black);
throw new Exception();
}
PacketHitList.MethodEnded(ref hitlist);
}