本文整理汇总了C#中CellState类的典型用法代码示例。如果您正苦于以下问题:C# CellState类的具体用法?C# CellState怎么用?C# CellState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CellState类属于命名空间,在下文中一共展示了CellState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Render
public static void Render(object item, int count, bool isExpanded, IDrawingToolkit tk,
IContext context, Area backgroundArea, Area cellArea, CellState state)
{
if (item is EventType) {
RenderAnalysisCategory (item as EventType, count, isExpanded, tk,
context, backgroundArea, cellArea);
} else if (item is SubstitutionEvent) {
SubstitutionEvent s = item as SubstitutionEvent;
RenderSubstitution (s.Color, s.EventTime, s.In, s.Out, s.Selected, isExpanded, tk, context,
backgroundArea, cellArea, state);
} else if (item is TimelineEvent) {
TimelineEvent p = item as TimelineEvent;
RenderPlay (p.Color, p.Miniature, p.Players, p.Selected, p.Description, count, isExpanded, tk,
context, backgroundArea, cellArea, state);
} else if (item is Player) {
RenderPlayer (item as Player, count, isExpanded, tk, context, backgroundArea, cellArea);
} else if (item is Playlist) {
RenderPlaylist (item as Playlist, count, isExpanded, tk, context, backgroundArea, cellArea);
} else if (item is PlaylistPlayElement) {
PlaylistPlayElement p = item as PlaylistPlayElement;
RenderPlay (p.Play.EventType.Color, p.Miniature, null, p.Selected, p.Description, count, isExpanded, tk,
context, backgroundArea, cellArea, state);
} else if (item is IPlaylistElement) {
IPlaylistElement p = item as IPlaylistElement;
RenderPlay (Config.Style.PaletteActive, p.Miniature, null, p.Selected, p.Description,
count, isExpanded, tk, context, backgroundArea, cellArea, state);
} else {
Log.Error ("No renderer for type " + item.GetType ());
}
}
开发者ID:GNOME,项目名称:longomatch,代码行数:30,代码来源:PlayslistCellRenderer.cs
示例2: GetCellBrush
private Brush GetCellBrush(CellState state)
{
if (state == CellState.Live)
return this.liveCellStyle ?? (this.liveCellStyle = Application.Current.FindResource("LiveCellBrush") as Brush);
return this.deadCellStyle ?? (this.deadCellStyle = Application.Current.FindResource("DeadCellBrush") as Brush);
}
开发者ID:taylan,项目名称:vita,代码行数:7,代码来源:CellStateToBrushConverter.cs
示例3: GameTile
public GameTile (GameObject tile, int x, int y)
{
Go = tile;
cellState = CellState.WhiteHidden;
locX = x;
locY = y;
}
开发者ID:weiguxp,项目名称:MMatrix,代码行数:7,代码来源:GameTile.cs
示例4: Program
/// <summary>
/// In this constructor main cycle is performed
/// </summary>
/// <param name="fold">path to game folder</param>
/// <param name="player">player symbol</param>
/// <param name="time">permited time</param>
public Program(string fold, CellState player, int time)
{
start = DateTime.Now;
Field field = new Field(fold);
int delta = 0;
# if DEBUG
delta = (new Random()).Next(Field.SIZE);//col shift, makes game more different
#endif
Solution root = new Solution(field, Solution.invertCell(player));
for (int i = 0; i < Field.SIZE; i++) {
Solution buf = new Solution(root, (i + delta) % Field.SIZE);
branch[i] = buf;
if (!buf.isFinalized)
que.Enqueue(buf);
}
while ((DateTime.Now - start).TotalMilliseconds + 300 < time && que.Count != 0)//main cycle
Solve(que.Dequeue());
Solution max = branch[0];
for (int i = 1; i < Field.SIZE; i++)
if (branch[i] != null)
max = branch[i].isGreater(max);
int turn = Directory.GetFiles(fold).Length / 2 + 1;
string path = fold + (player == CellState.Cross ? "X" : "O") + turn.ToString() + ".txt";
File.WriteAllLines(path, new String[] { max.getTurn() });
}
开发者ID:opot,项目名称:BrainTic,代码行数:36,代码来源:Program.cs
示例5: SetCell
public void SetCell( CellState cs, int row, int col )
{
Util.RangeCheck(row, 1, width);
Util.RangeCheck(col, 1, width);
d_board[ToIndex(row), ToIndex(col)] = cs;
}
开发者ID:rmhenne,项目名称:Golib,代码行数:7,代码来源:BoardModel.cs
示例6: PlaceRecordItem
public PlaceRecordItem(
OverturnableInfo placeAndTurnableInfo,
CellState stoneColor)
{
PlaceAndTurnableInfo = placeAndTurnableInfo;
StoneColor = stoneColor;
}
开发者ID:furinji,项目名称:Reversi,代码行数:7,代码来源:PlaceRecordItem.cs
示例7: move_to_next
public void move_to_next()
{
hasChanges = state == next_state ? false : true;
last_state = state;
state = next_state;
next_state = CellState.Unknown;
}
开发者ID:ccjjharmon,项目名称:GameOfLife,代码行数:7,代码来源:DefaultCell.cs
示例8: DrainEnergy
public int DrainEnergy()
{
if (State != CellState.Dead)
{
Energy--;
if (Energy <= 4)
{
State = CellState.Sick;
}
if (Energy <= 0)
{
SoundManager.PlaySound(GameAssets.CellDeadSound, Position, 1F);
State = CellState.Dead;
this.Tint = new Color(50, 50, 50, 128);
GameStats.IncrementDeadCellCount();
}
return 1;
}
else
{
return 0;
}
}
开发者ID:Wydra,项目名称:LD24,代码行数:25,代码来源:Cell.cs
示例9: GenerateSong
public static CellState[,] GenerateSong(Automatone automatone, Random random, MusicTheory theory)
{
InputParameters.Instance.Tempo = (ushort)(theory.MIN_TEMPO + InputParameters.Instance.SongSpeed * (theory.MAX_TEMPO - theory.MIN_TEMPO));
InputParameters.Instance.TimeSignatureN = (int)(2 + random.NextDouble() / 4 * (13 - 2));
InputParameters.Instance.TimeSignatureD = (int)Math.Pow(2, (int)(1 + random.NextDouble() * 2));
Song s = new Song(theory, random);
NoteThread thread = new NoteThread(s.Notes, InputParameters.Instance.TimeSignature);
int gridWidth = s.MeasureCount * s.MeasureLength;
CellState[,] grid = new CellState[Automatone.PIANO_SIZE,gridWidth];
foreach (List<Note> nts in s.Notes)
{
foreach (Note n in nts)
{
grid[n.GetOctave() * MusicTheory.OCTAVE_SIZE + n.GetNoteName().ChromaticIndex - Automatone.LOWEST_NOTE_CHROMATIC_NUMBER, (int)Math.Min(n.GetStartMeasure() * s.MeasureLength + n.GetStartBeat() * Automatone.SUBBEATS_PER_WHOLE_NOTE, gridWidth - 1)] = CellState.START;
for (int i = 1; i < n.GetRemainingDuration() * Automatone.SUBBEATS_PER_WHOLE_NOTE; i++)
{
if (grid[n.GetOctave() * MusicTheory.OCTAVE_SIZE + n.GetNoteName().ChromaticIndex - Automatone.LOWEST_NOTE_CHROMATIC_NUMBER, (int)Math.Min(n.GetStartMeasure() * s.MeasureLength + n.GetStartBeat() * Automatone.SUBBEATS_PER_WHOLE_NOTE + i, gridWidth - 1)] == CellState.SILENT)
{
grid[n.GetOctave() * MusicTheory.OCTAVE_SIZE + n.GetNoteName().ChromaticIndex - Automatone.LOWEST_NOTE_CHROMATIC_NUMBER, (int)Math.Min(n.GetStartMeasure() * s.MeasureLength + n.GetStartBeat() * Automatone.SUBBEATS_PER_WHOLE_NOTE + i, gridWidth - 1)] = CellState.HOLD;
}
}
}
}
automatone.MeasureLength = s.MeasureLength;
return grid;
}
开发者ID:verngutz,项目名称:Automatone,代码行数:26,代码来源:SongGenerator.cs
示例10: Formula
private Value v; // Up to date if state==Uptodate
public Formula(Workbook workbook, Expr e) {
Debug.Assert(workbook != null);
Debug.Assert(e != null);
this.workbook = workbook;
this.e = e;
this.state = CellState.Uptodate;
}
开发者ID:josiahdj,项目名称:SDFCalc,代码行数:9,代码来源:Formula.cs
示例11: Cell
public Cell(Texture2D texture, Rectangle drawBounds)
: base(texture, drawBounds)
{
this.Type = SpriteType.Cell;
this.Energy = 7;
this.State = CellState.Living;
}
开发者ID:Wydra,项目名称:LD24,代码行数:7,代码来源:Cell.cs
示例12: Clicked
public void Clicked(CellController cell)
{
if (!Attack)
{
switch (this.state)
{
case CellState.None:
if (SelectedCells.Count < ShipAmount.TotalCellAmount)
{
this.state = CellState.Selected;
SelectedCells.Add(this);
}
break;
case CellState.Selected:
this.state = CellState.None;
SelectedCells.Remove(this);
break;
}
this.Invalidate();
}
else
{
if (!Locked)
{
if (EnemyCell)
{
state = CellState.Selected;
Invalidate();
ShipAmount.TotalCellAmount--;
}
MainController.DoAttack();
}
}
}
开发者ID:patrickpissurno,项目名称:Battleship-Online,代码行数:34,代码来源:CellController.cs
示例13: InitializeForestFire
private static CellState[,] InitializeForestFire(int height, int width)
{
// Create our state array, initialize all indices as Empty, and return it.
var state = new CellState[height, width];
state.Initialize();
return state;
}
开发者ID:travis1230,项目名称:RosettaCodeData,代码行数:7,代码来源:forest-fire.cs
示例14: SelectBestCell
public override Point SelectBestCell(CellState color) {
foreach(Point attempt in Board.EnumerateCells()) {
if(Board.GetStone(attempt) == CellState.None)
return attempt;
}
return Draw;
}
开发者ID:feldma,项目名称:Gomoku,代码行数:7,代码来源:DumbLogic.cs
示例15: OverTurnStonesPhase
public OverTurnStonesPhase(CellState colorToTurn)
{
_placePos = new System.Drawing.Point(-1, -1);
_turnPosList = new List<System.Drawing.Point>();
_colorToTurn = colorToTurn;
Init();
}
开发者ID:furinji,项目名称:Reversi,代码行数:7,代码来源:OverTurnStonesPhase.cs
示例16: Update
// Update is called once per frame
void Update()
{
// なにやら蠢く感じを出したいなぁと思ってとりあえず回してみる
transform.Rotate (1.0f, 1.0f, 1.0f);
switch(m_State)
{
case CellState.CELL_STATE_BORN:
// 生まれた時は 1.0 の大きさになるまでは膨らみます
m_Size += 0.1f;
if(m_Size > 1.0f)
{
m_Size = 1.0f;
m_State = CellState.CELL_STATE_IDLE;
}
transform.localScale = new Vector3(m_Size, m_Size, m_Size);
break;
case CellState.CELL_STATE_DEATH:
// 死ぬときは 0.0 以下になるまで縮みます.
m_Size -= 0.1f;
if(m_Size < 0.0f)
{
m_Size = 0.0f;
Destroy(gameObject);
}
transform.localScale = new Vector3(m_Size, m_Size, m_Size);
break;
default:
// 通常時は特に膨らみもしぼみもしません.
break;
}
}
开发者ID:kimsama,项目名称:UnitySandbox,代码行数:32,代码来源:CellScript.cs
示例17: GetOpponentColor
public CellState GetOpponentColor(CellState myColor)
{
if(myColor == CellState.White)
return CellState.Black;
if(myColor == CellState.Black)
return CellState.White;
throw new ArgumentException();
}
开发者ID:gomoku,项目名称:Stones,代码行数:8,代码来源:Logic.cs
示例18: Cell
public Cell(int r, int c)
{
rowPos = r;
colPos = c;
state = CellState.empty;
connectCells = new SortedDictionary<int, List<Cell>>();
observers = new SortedDictionary<int, HashSet<Cell>>();
}
开发者ID:moconno,项目名称:ConnectFour,代码行数:8,代码来源:Cell.cs
示例19: Reset
public void Reset()
{
g = 0;
h = 0;
parent = null;
State = CellState.Empty;
Path = PathState.None;
}
开发者ID:xposure,项目名称:BOTA,代码行数:8,代码来源:Grid.cs
示例20: DefaultCell
public DefaultCell(int x, int y, CellState state)
{
this.state = state;
next_state = CellState.Unknown;
last_state = CellState.Unknown;
this.location = location;
location = new XY(x, y);
hasChanges = false;
}
开发者ID:ccjjharmon,项目名称:GameOfLife,代码行数:9,代码来源:DefaultCell.cs
注:本文中的CellState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论