本文整理汇总了C#中Enums类的典型用法代码示例。如果您正苦于以下问题:C# Enums类的具体用法?C# Enums怎么用?C# Enums使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Enums类属于命名空间,在下文中一共展示了Enums类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Inventory
public Inventory(int ID,
Enums.Entity_Type Entity_Type,
int Container_ID,
int Capacity)
{
NewInventory(ID, Entity_Type, Container_ID, Capacity);
}
示例2: MetaDataToEntity
public MetaDataToEntity(int ID,
Enums.Entity_Type Entity_Type,
string MetaData_Key,
string Value)
{
NewMetaDataToEntity(ID, Entity_Type, MetaData_Key, Value);
}
示例3: Change
public void Change(Enums.Suit cardSuit, Enums.Number cardNumber)
{
suit = cardSuit;
number = cardNumber;
Refresh();
}
示例4: CreateNewAction
public override Action_Base CreateNewAction(Enums.ActionType _type, GameObject _object)
{
switch (_type)
{
case Enums.ActionType.action_click:
switch(_object.tag)
{
case "attackButton":
return new Action_ChangeState(Enums.GameStates.gamestate_AimAttack);
break;
case "buildButton":
if (_object.GetComponent<CanBuildTurret>() != null)
{
return new Action_Build(Enums.EntityTypes.turret);
}
else if (_object.GetComponent<CanBuildCrystal>() != null)
{
return new Action_Build(Enums.EntityTypes.crystal);
}
break;
}
break;
case Enums.ActionType.action_backUp:
return new Action_ChangeState(Enums.GameStates.gamestate_waitingForCommand);
break;
}
return null;
}
示例5: SetBattleStateInRoomCP
/// <summary>
/// ルームCP内BattleState要素変更メソッド
/// <para> 引数に設定された内容でBattleStateの値を更新する。</para>
/// <para> また、本BattleStateの更新はマスタークライアント側が行う。</para>
/// </summary>
/// <param name="newValue">更新する新しいBattleStateの値</param>
public void SetBattleStateInRoomCP(Enums.BattleState newValue)
{
// マスタークライアントでない者が設定しようとした場合は抜ける
if (!PhotonNetwork.isMasterClient) return;
roomCP["BS"] = newValue;
}
示例6: switch
public double this[Enums.Velocity index]
{
get
{
switch (index)
{
case Enums.Velocity.MeterPerSecond:
return value;
case Enums.Velocity.KilometerPerHour:
return value*Constants.Hour/Constants.Kilometer;
case Enums.Velocity.Knots:
return value*Constants.Hour/Constants.NMile;
default:
return 0;
}
}
set
{
switch (index)
{
case Enums.Velocity.MeterPerSecond:
this.value = value;
break;
case Enums.Velocity.KilometerPerHour:
this.value = value*Constants.Kilometer/Constants.Hour;
break;
case Enums.Velocity.Knots:
this.value = value*Constants.NMile/Constants.Hour;
break;
default:
break;
}
}
}
示例7: MesFechaString
public static string MesFechaString(Enums.Meses mes)
{
switch (mes)
{
case Enums.Meses.Enero:
return Properties.Resources.rxEnero;
case Enums.Meses.Febrero:
return Properties.Resources.rxFebrero;
case Enums.Meses.Marzo:
return Properties.Resources.rxMarzo;
case Enums.Meses.Abril:
return Properties.Resources.rxAbril;
case Enums.Meses.Mayo:
return Properties.Resources.rxMayo;
case Enums.Meses.Junio:
return Properties.Resources.rxJunio;
case Enums.Meses.Julio:
return Properties.Resources.rxJulio;
case Enums.Meses.Agosto:
return Properties.Resources.rxAgosto;
case Enums.Meses.Setiembre:
return Properties.Resources.rxSetiembre;
case Enums.Meses.Octubre:
return Properties.Resources.rxOctubre;
case Enums.Meses.Noviembre:
return Properties.Resources.rxNoviembre;
case Enums.Meses.Diciembre:
return Properties.Resources.rxDiciembre;
}
return string.Empty;
}
示例8: ChangeGameState
//Change the game state (occurs on next frame)
public void ChangeGameState(Enums.GameStateNames nextState)
{
if (!m_gameStateDictionary.ContainsKey(nextState))
return;
m_nextGameStateIndex = nextState;
}
示例9: InvalidColumnValue
public static bool InvalidColumnValue(
object fieldValue, Enums.Operator op,
string valueToCompare, Type fieldValueType)
{
return ConditionEvaluator.MatchItemValueBasedOnOperatorAndValueType(
op, valueToCompare, fieldValue, fieldValueType);
}
示例10: InvalidLengthValue
public static bool InvalidLengthValue(int length, Enums.Operator op,
string lengthToCompare)
{
int intlengthToCompare;
if (int.TryParse(lengthToCompare, out intlengthToCompare))
{
switch (op)
{
case Enums.Operator.Equal:
return length == intlengthToCompare;
case Enums.Operator.NotEqual:
return length != intlengthToCompare; ;
case Enums.Operator.GreaterThan:
return length > intlengthToCompare;
case Enums.Operator.LessThan:
return length < intlengthToCompare;
default:
return false;
}
}
else
{
return true;
}
}
示例11: switch
public double this[Enums.Time index]
{
get
{
switch (index)
{
case Enums.Time.Second:
return value;
case Enums.Time.Minutes:
return value/Constants.Minutes;
case Enums.Time.Hour:
return value/Constants.Hour;
default:
return 0;
}
}
set
{
switch (index)
{
case Enums.Time.Second:
this.value = value;
break;
case Enums.Time.Minutes:
this.value = value*Constants.Minutes;
break;
case Enums.Time.Hour:
this.value = value*Constants.Hour;
break;
default:
break;
}
}
}
示例12: ContainersCore
//заполнение параметров контейнера
protected ContainersCore(Enums.ContainerType containerType, int id, double area, double dencity)
{
this.containerType = containerType;
this.area = area;
this.dencity = dencity;
this.id = id;
}
示例13: CreateTurret
//===================================================
// PUBLIC METHODS
//===================================================
/// <summary>
/// Creates a turret.
/// </summary>
/// <param name="turretType">Type of the turret.</param>
/// <param name="position">The position.</param>
public void CreateTurret( Enums.TurretType turretType, Vector3 position )
{
GameObject tempGO = null;
switch( turretType ) {
case Enums.TurretType.Type_A:
tempGO = turretPrefabA;
break;
case Enums.TurretType.Type_B:
tempGO = turretPrefabB;
break;
case Enums.TurretType.Type_C:
tempGO = turretPrefabC;
break;
case Enums.TurretType.Type_D:
tempGO = turretPrefabD;
break;
default:
tempGO = turretPrefabA;
break;
}
GameObject turretGO = Instantiate( tempGO, position, Quaternion.identity ) as GameObject;
turretGO.transform.SetParent( turretContainer );
turrets.Add( turretGO );
}
示例14: Move
public void Move(Enums.ActionType _type)
{
int _oldX;
int _oldY;
switch(_type)
{
case Enums.ActionType.action_right:
_oldX = storage.xPos;
_oldY = storage.yPos;
storage.GameWorld.RemoveObjectFromTile(_oldX, _oldY, this.gameObject);
storage.xPos = _oldX + 1;
storage.yPos = storage.GameWorld.GetColumnHeight(storage.xPos);
storage.GameWorld.AddObjectToTile(storage.xPos, storage.yPos, this.gameObject);
this.gameObject.transform.Translate(1,storage.yPos - _oldY,0);
break;
case Enums.ActionType.action_left:
_oldX = storage.xPos;
_oldY = storage.yPos;
storage.GameWorld.RemoveObjectFromTile(_oldX, _oldY, this.gameObject);
storage.xPos = _oldX - 1;
storage.yPos = storage.GameWorld.GetColumnHeight(storage.xPos);
storage.GameWorld.AddObjectToTile(storage.xPos, storage.yPos, this.gameObject);
this.gameObject.transform.Translate(-1,storage.yPos - _oldY,0);
break;
}
}
示例15: ReturnObject
public ReturnObject(Enums.Return_Status Return_Status,
string Friendly_Message,
string Technical_Message,
object Return_Object)
{
NewReturnObject(Return_Status, Friendly_Message, Technical_Message, Return_Object, string.Empty);
}