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


C# Enumeration.ToString方法代码示例

本文整理汇总了C#中Enumeration.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Enumeration.ToString方法的具体用法?C# Enumeration.ToString怎么用?C# Enumeration.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Enumeration的用法示例。


在下文中一共展示了Enumeration.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Chomper

        public Chomper(RoomNew room, ContentManager Content, Enumeration.TileType tileType, Enumeration.StateTile state, Enumeration.TileType NextTileType__1)
        {
            base.room = room;

            nextTileType = NextTileType__1;
            System.Xml.Serialization.XmlSerializer ax = new System.Xml.Serialization.XmlSerializer(tileSequence.GetType());

            Stream txtReader = Microsoft.Xna.Framework.TitleContainer.OpenStream(PrinceOfPersiaGame.CONFIG_PATH_CONTENT + PrinceOfPersiaGame.CONFIG_PATH_SEQUENCES + tileType.ToString().ToUpper() + "_sequence.xml");

            tileSequence = (List<Sequence>)ax.Deserialize(txtReader);

            foreach (Sequence s in tileSequence)
            {
                s.Initialize(Content);
            }

            //Search in the sequence the right type
            //Sequence result = tileSequence.Find((Sequence s) => s.name.ToUpper() == state.ToString().ToUpper());
            Sequence result = tileSequence.Find((Sequence s) => s.name == state.ToString().ToUpper());

            if (result != null)
            {
                result.frames[0].SetTexture(Content.Load<Texture2D>(PrinceOfPersiaGame.CONFIG_TILES[0] + result.frames[0].value));

                collision = result.collision;
                Texture = result.frames[0].texture;
            }
            Type = tileType;

            //change statetile element
            tileState.Value().state = state;
            tileAnimation.PlayAnimation(tileSequence, tileState.Value());
        }
开发者ID:salvadorc17,项目名称:Prince-Monogame,代码行数:33,代码来源:Chomper.cs

示例2: GetActionPositionRun

        static string GetActionPositionRun(Hands[] hands, int position, int run, Enumeration.Street street)
        {
            var user = hands.Single(x => x.Position == position).User;
            string action;
            switch (street)
            {
                case Enumeration.Street.Blind:
                    action = hands.Single(x => x.Position == position).ActionBlind;
                    break;
                case Enumeration.Street.Preflop:
                    action = hands.Single(x => x.Position == position).ActionPreflop;
                    break;
                case Enumeration.Street.Flop:
                    action = hands.Single(x => x.Position == position).ActionFlop;
                    break;
                case Enumeration.Street.Turn:
                    action = hands.Single(x => x.Position == position).ActionTurn;
                    break;
                case Enumeration.Street.River:
                    action = hands.Single(x => x.Position == position).ActionRiver;
                    break;
                default:
                    throw new ArgumentException("this street does not exist", street.ToString());
            }

            if (action == string.Empty)
                return string.Empty;

            if (action.Split(',').Count() > run)
                return user + " " + action.Split(',')[run];

            return string.Empty;
        }
开发者ID:daaaasdev,项目名称:trackerparser,代码行数:33,代码来源:Program.cs

示例3: Sprite

 public Sprite(int id, Enumeration.SpriteType type, int x, int y)
 {
     Id = id;
        Type = type;
        Name = type.ToString();
        X = x;
        Y = y;
        Bounds = new Rectangle(x, y, 64, 74);
        Flip = false;
 }
开发者ID:salvadorc17,项目名称:Prince-Monogame,代码行数:10,代码来源:Sprite.cs

示例4: Gate

        public Gate(RoomNew room, ContentManager Content, Enumeration.TileType tileType, Enumeration.StateTile state, int switchButton, Enumeration.TileType NextTileType__1, float TimeOpen__2)
        {
            collision = Enumeration.TileCollision.Platform;
            base.room = room;
            nextTileType = NextTileType__1;
            timeOpen = TimeOpen__2;

            this.switchButton = switchButton;
            System.Xml.Serialization.XmlSerializer ax = new System.Xml.Serialization.XmlSerializer(tileSequence.GetType());
            Stream txtReader = Microsoft.Xna.Framework.TitleContainer.OpenStream(PrinceOfPersiaGame.CONFIG_PATH_CONTENT + PrinceOfPersiaGame.CONFIG_PATH_SEQUENCES + tileType.ToString().ToUpper() + "_sequence.xml");

            //TextReader txtReader = File.OpenText(PrinceOfPersiaGame.CONFIG_PATH_CONTENT + PrinceOfPersiaGame.CONFIG_PATH_SEQUENCES + tileType.ToString().ToUpper() + "_sequence.xml");

            tileSequence = (List<Sequence>)ax.Deserialize(txtReader);

            foreach (Sequence s in tileSequence)
            {
            s.Initialize(Content);
            }

            if (state == Enumeration.StateTile.normal)
            {
            state = Enumeration.StateTile.closed;
            }

            //Search in the sequence the right type
            Sequence result = tileSequence.Find((Sequence s) => s.name == state.ToString().ToUpper());

            if (result != null)
            {
            //AMF to be adjust....
            result.frames[0].SetTexture(Content.Load<Texture2D>(PrinceOfPersiaGame.CONFIG_TILES[0] + result.frames[0].value));

            collision = result.collision;
            Texture = result.frames[0].texture;
            }
            Type = tileType;

            //change statetile element
            tileState.Value().state = state;
            tileAnimation.PlayAnimation(tileSequence, tileState.Value());
        }
开发者ID:salvadorc17,项目名称:Prince-Monogame,代码行数:42,代码来源:Gate.cs

示例5: Tile

        public Tile(RoomNew room, ContentManager Content, Enumeration.TileType tileType, Enumeration.StateTile state, Enumeration.Items eitem, Enumeration.TileType NextTileType__1)
        {
            this.room = room;
            nextTileType = NextTileType__1;

            System.Xml.Serialization.XmlSerializer ax = new System.Xml.Serialization.XmlSerializer(m_tileSequence.GetType());

            Stream txtReader = Microsoft.Xna.Framework.TitleContainer.OpenStream(PrinceOfPersiaGame.CONFIG_PATH_CONTENT + PrinceOfPersiaGame.CONFIG_PATH_SEQUENCES + tileType.ToString().ToUpper() + "_sequence.xml");
            //TextReader txtReader = File.OpenText(PrinceOfPersiaGame.CONFIG_PATH_CONTENT + PrinceOfPersiaGame.CONFIG_PATH_SEQUENCES + tileType.ToString().ToUpper() + "_sequence.xml");

            m_tileSequence = (List<Sequence>)ax.Deserialize(txtReader);

            foreach (Sequence s in m_tileSequence)
            {
                s.Initialize(Content);
            }

            //Search in the sequence the right type
            Sequence result = m_tileSequence.Find((Sequence s) => s.name == state.ToString().ToUpper());

            if (result != null)
            {
                //AMF to be adjust....
                result.frames[0].SetTexture(Content.Load<Texture2D>(PrinceOfPersiaGame.CONFIG_TILES[0] + result.frames[0].value));

                collision = result.collision;
                Texture = result.frames[0].texture;
            }
            Type = tileType;

            //change statetile element
            StateTileElement stateTileElement = new StateTileElement();
            stateTileElement.state = state;
            tileState.Add(stateTileElement);
            tileAnimation.PlayAnimation(m_tileSequence, tileState.Value());

            //load item
            switch (eitem)
            {
                case Enumeration.Items.flask:
                    item = new Flask(Content);
                    break; // TODO: might not be correct. Was : Exit Select

                case Enumeration.Items.flaskbig:
                    item = new FlaskBig(Content);
                    break; // TODO: might not be correct. Was : Exit Select

                case Enumeration.Items.sword:
                    item = new Sword(Content);
                    break; // TODO: might not be correct. Was : Exit Select

            }
        }
开发者ID:salvadorc17,项目名称:Prince-Monogame,代码行数:53,代码来源:Tile.cs


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