本文整理汇总了C#中Difficulty类的典型用法代码示例。如果您正苦于以下问题:C# Difficulty类的具体用法?C# Difficulty怎么用?C# Difficulty使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Difficulty类属于命名空间,在下文中一共展示了Difficulty类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Field
public Field(Game game, int Level, Difficulty difficulty)
: base(game)
{
therand = new Random(); // Good enough randomization for now?
m_difficulty = difficulty;
RandomField();
m_below_field = new BlockColour[6, 2];
for (int x = 0; x < 6; x++)
{
m_below_field[x, 0] = m_field[x, 0].Colour;
}
MakeBelowRow();
MakeBelowRow();
m_lift_phase = 0;
m_cruiser_pos = new Point(2, 5);
m_state = GameState.Main;
m_counter = 60;
m_level = Level;
m_score = 0;
m_fast_lifting = false;
m_chain_length = 1;
CalcLiftSpeed();
CalcFlashFrames();
}
示例2: PlayGame
/// <summary>
/// Initializes gameplay phase
/// </summary>
/// <param name="difficulty">The chosen difficulty</param>
/// <param name="buttons">The submitted placement of ships</param>
/// <param name="name">The name of the player</param>
public PlayGame(Difficulty difficulty, Button[] buttons, string name, Ship[] ships, MainWindow main)
{
InitializeComponent();
this.main = main;
// Set player name
this.name = name.ToLower().Replace(' ', '_');
// Set player and computer's ships
shipsPlayer = ships;
shipsComputer = new Ship[] {
new Ship(ShipName.AIRCRAFT_CARRIER, 5),
new Ship(ShipName.BATTLESHIP, 4),
new Ship(ShipName.SUBMARINE, 3),
new Ship(ShipName.CRUISER, 3),
new Ship(ShipName.DESTROYER, 2)
};
// Set button field arrays
buttonsPlayer = new Button[100];
PlayerShips.Children.CopyTo(buttonsPlayer, 0);
buttonsComputer = new Button[100];
ComputerShips.Children.CopyTo(buttonsComputer, 0);
common = new Common(ComputerShips, buttonsComputer);
computerAI = new ComputerAI(this, difficulty);
initializeGame(buttons);
}
示例3: MainPage
public MainPage(Difficulty difficulty)
{
App.Current.MainWindow.WindowState = WindowState.Maximized;
this.difficulty = difficulty;
InitializeComponent();
LayoutRoot.SizeChanged += LayoutRoot_SizeChanged;
}
示例4: ZombieMountain
public ZombieMountain(Difficulty difficulty, Hero hero)
: base(difficulty, hero)
{
if (difficulty == Difficulty.Easy)
{
this.initialHitPercentage = 70;
this.fastReaction = (int)ReactionTime.Normal;
this.averageReaction = (int)ReactionTime.Slow;
this.slowReaction = (int)ReactionTime.UltraSlow;
}
else if (difficulty == Difficulty.Medium)
{
this.initialHitPercentage = 60;
this.fastReaction = (int)ReactionTime.Fast;
this.averageReaction = (int)ReactionTime.Normal;
this.slowReaction = (int)ReactionTime.Slow;
}
else
{
this.initialHitPercentage = 45;
this.fastReaction = (int)ReactionTime.UltraFast;
this.averageReaction = (int)ReactionTime.Fast;
this.slowReaction = (int)ReactionTime.Normal;
}
enemy = new Enemy(PlayerStats.Zombie, Armor.None, Weapon.None, Magic.StrongHit);
}
示例5: Stat
public Stat(string id, int level, int str, int per, int end, int agi, int luck, int bigGuns, int energyWeapons, int explosives, int smallGuns, int unarmed, int melee, Difficulty diff)
{
this.ID = id;
this.Strength = str;
this.Perception = per;
this.Endurance = end;
this.Agility = agi;
this.Luck = luck;
this.HP = (15 + str + (2 * end)) + (level * (3 + (end / 2)));
this.ActionPoints = 5 + ((agi / 2) + (end / 2));
this.CriticalChance = luck;
this.PoisonResistance = end * 5;
this.RadiationResistance = end * 2;
this.MeleeDamage = Math.Max(str - 5, 0);
this.Sequence = per * 2;
this.AC = agi;
this.BigGuns = bigGuns;
this.EnergyWeapons = energyWeapons;
this.Explosives = explosives;
this.SmallGuns = smallGuns;
this.Unarmed = unarmed;
this.Melee = melee;
this.Diff = diff;
}
示例6: Game
public Game(ref Player playerA,ref Player playerB,Difficulty difficulty,GameMode gameMode)
{
current_game = this;
board = new PlayerType[3,3]{{PlayerType.NONE,PlayerType.NONE,PlayerType.NONE},
{PlayerType.NONE,PlayerType.NONE,PlayerType.NONE},
{PlayerType.NONE,PlayerType.NONE,PlayerType.NONE}};
this.playerA = playerA;
this.playerA.score = 0;
this.playerB = playerB;
this.difficulty = difficulty;
this.game_mode = gameMode;
if (game_mode == GameMode.SINGLE_PLAYER)
{
//playerA.name = "User";
playerB.name = "Computer";
playerA.moveAllowed = true;
playerB.moveAllowed = false;
}else if(game_mode == GameMode.MULTI_PLAYER_STANDALONE){
//playerA.name = "Ball";
playerB.name = "Cross";
//playerA.moveAllowed = true;
playerB.moveAllowed = false;
this.difficulty = Difficulty.NONE;
}
else if (game_mode == GameMode.MULTI_PLAYER)
{
this.difficulty = Difficulty.NONE;
}
this.current_player = playerA;
this.connected = false;
}
示例7: OnHardClick
void OnHardClick(GameObject go)
{
dif = Difficulty.Hard;
Debug.Log("OnHardClick " + dif);
SceneManager.LoadScene("Level");
}
示例8: Stage
public Stage(Difficulty timeDiff, Difficulty numProbsDiff, Difficulty distDiff)
{
this.NumberOfProblemsDifficulty = numProbsDiff;
this.TimeDifficulty = timeDiff;
this.DistractionsDifficulty = distDiff;
PrepareStage();
}
示例9: ConstructRitual
public void ConstructRitual(int length, Difficulty difficulty)
{
reward = Reward.GetReward(length);
ritual = new List<RitualKey>();
List<KeyCodes> keyCodesPool = new List<KeyCodes>()
{
KeyCodes.A, KeyCodes.B, KeyCodes.X, KeyCodes.Y
};
if (difficulty == Difficulty.Medium)
{
keyCodesPool.AddRange(new KeyCodes[4]{ KeyCodes.Left, KeyCodes.Right, KeyCodes.Up, KeyCodes.Down });
}
if (difficulty == Difficulty.Hard)
{
keyCodesPool.AddRange(new KeyCodes[4] { KeyCodes.LT, KeyCodes.RT, KeyCodes.LB, KeyCodes.RB });
}
for (int i = 0; i < length; ++i)
{
RitualKey ritualKey = new RitualKey(keyCodesPool[Random.Range(0, keyCodesPool.Count)]);
ritual.Add(ritualKey);
}
PostChangedEvent();
}
示例10: AddEntries
private void AddEntries(Difficulty difficultyLevel)
{
int counter = 0;
HighScoresTextBox.Text = " High Scores - " + difficultyLevel.ToString();
HighScoresTextBox.Text += "\r\n";
HighScoresTextBox.Text += "\r\n # Date & Time Duration Score";
HighScoresTextBox.Text += "\r\n ---------------------------------------------";
if (m_highScores.ContainsKey(difficultyLevel))
{
List<HighScoreEntry> scoreEntries = m_highScores[difficultyLevel];
scoreEntries.Sort(CompareHighScores);
foreach (HighScoreEntry highScore in scoreEntries)
{
counter++;
HighScoresTextBox.Text += string.Format("\r\n {0,2} {1} {2} {3,10}",
counter,
highScore.GameTime.ToString("dd-MMM-yyyy HH:mm"),
SiriusSudokuForm.GetTimeText(highScore.DurationSeconds),
highScore.FinalScore.ToString());
}
}
for (; counter < 11; counter++)
{
HighScoresTextBox.Text += string.Format("\r\n {0,2}", counter);
}
}
示例11: EncodingGame
public EncodingGame(Difficulty _difficulty)
{
isCodeCracked = false;
numTurns = 0;
currPlayer = PlayerTurn.User;
difficulty = _difficulty;
}
示例12: computerAI
public computerAI(string name, bool isActive, ImageBrush computerImage, ImageBrush computerImageHover, Difficulty difficulty)
{
this._Name = name;
this._ActivePlayer = isActive;
this._Image = computerImage;
this._ImageHover = computerImageHover;
switch(difficulty)
{
case Difficulty.Beginner:
this._MaxTreeDepth = 1;
this._DifficultyLevel = Difficulty.Beginner;
break;
case Difficulty.Easy:
this._MaxTreeDepth = 1;
this._DifficultyLevel = Difficulty.Easy;
break;
case Difficulty.Medium:
this._MaxTreeDepth = 2;
this._DifficultyLevel = Difficulty.Medium;
break;
case Difficulty.Hard:
this._MaxTreeDepth = 3;
this._DifficultyLevel = Difficulty.Hard;
break;
default:
this._MaxTreeDepth = 3;
this._DifficultyLevel = Difficulty.Hard;
break;
}
}
示例13: Game
public Game(List<Player> players, Difficulty difficulty, Type type, MapProvider mapProvider)
{
m_players = players;
m_difficulty = difficulty;
m_type = type;
m_mapProvider = mapProvider;
}
示例14: Option
internal Option()
{
_Difficulty = Difficulty.Medium;
_Player = StoneColor.White;
_StartColor = StoneColor.Black;
Changed = true;
}
示例15: DarkForestLevel
public DarkForestLevel(Difficulty difficulty, Hero hero)
: base(difficulty, hero)
{
this.bitePower = (int)(enemy.PlayerStats.AttackPower * this.Hero.PlayerStats.CalculateDefencePercentage());
this.agilityEffect = this.Hero.PlayerStats.CalculateAgilityPercentage();
if (difficulty == Difficulty.Easy)
{
this.fastReaction = (int)ReactionTime.Normal * this.agilityEffect;
this.averageReaction = (int)ReactionTime.Slow * this.agilityEffect;
this.slowReaction = (int)ReactionTime.UltraSlow * this.agilityEffect;
}
else if (difficulty == Difficulty.Medium)
{
this.fastReaction = (int)ReactionTime.Fast * this.agilityEffect;
this.averageReaction = (int)ReactionTime.Normal * this.agilityEffect;
this.slowReaction = (int)ReactionTime.Slow * this.agilityEffect;
}
else
{
this.fastReaction = (int)ReactionTime.UltraFast * this.agilityEffect;
this.averageReaction = (int)ReactionTime.Fast * this.agilityEffect;
this.slowReaction = (int)ReactionTime.Normal * this.agilityEffect;
}
}