本文整理汇总了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());
}
示例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;
}
示例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;
}
示例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());
}
示例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
}
}