当前位置: 首页>>代码示例>>C#>>正文


C# ICharacter.ToString方法代码示例

本文整理汇总了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());
     }
 }
开发者ID:WeeWorld,项目名称:Swiffotron,代码行数:27,代码来源:CharacterDump.cs

示例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);
        }
开发者ID:damy90,项目名称:Telerik-all,代码行数:14,代码来源:Engine.cs

示例3: GetCharacterClass

 private static string GetCharacterClass(ICharacter character)
 {
     string[] characterMeta = character.ToString().Split('.');
     return characterMeta[characterMeta.Length - 1];
 }
开发者ID:ivnikolov,项目名称:RPG-Teamwork,代码行数:5,代码来源:Battle.cs

示例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);
        }
开发者ID:MandL27,项目名称:Server,代码行数:73,代码来源:StatusScript.cs


注:本文中的ICharacter.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。