public ChitVisual(Point2D point, EChitNumber n) : base(point) { this._Number = n; Init(); }
/// <summary> /// Function to enable UI behaviour where the user can click or hit a button /// to decrease the chitnumber. /// </summary> /// <param name="n">Current chitnumber</param> /// <returns>Previous chitnumber</returns> public static EChitNumber GetPreviousChit(EChitNumber n) { switch (n) { case EChitNumber.N2: return EChitNumber.N12; case EChitNumber.N3: return EChitNumber.N2; case EChitNumber.N4: return EChitNumber.N3; case EChitNumber.N5: return EChitNumber.N4; case EChitNumber.N6: return EChitNumber.N5; case EChitNumber.N8: return EChitNumber.N6; case EChitNumber.N9: return EChitNumber.N8; case EChitNumber.N10: return EChitNumber.N9; case EChitNumber.N11: return EChitNumber.N10; case EChitNumber.N12: return EChitNumber.N11; } return EChitNumber.N4; }
private void ChitButtonMouseDown(object sender, RoutedEventArgs e) { Button button = (Button)sender; switch (button.Name) { case "btnChit2": _CurrentChitNumber = EChitNumber.N2; break; case "btnChit3": _CurrentChitNumber = EChitNumber.N3; break; case "btnChit4": _CurrentChitNumber = EChitNumber.N4; break; case "btnChit5": _CurrentChitNumber = EChitNumber.N5; break; case "btnChit6": _CurrentChitNumber = EChitNumber.N6; break; case "btnChit8": _CurrentChitNumber = EChitNumber.N8; break; case "btnChit9": _CurrentChitNumber = EChitNumber.N9; break; case "btnChit10": _CurrentChitNumber = EChitNumber.N10; break; case "btnChit11": _CurrentChitNumber = EChitNumber.N11; break; case "btnChit12": _CurrentChitNumber = EChitNumber.N12; break; case "btnChitRandom": _CurrentChitNumber = EChitNumber.Random; break; case "btnChitNone": _CurrentChitNumber = EChitNumber.None; break; } this.mapEditorViewPort.InteractionBehaviour = new ChooseChitBehaviour(_CurrentChitNumber); }
public ChooseChitBehaviour(EChitNumber number) { _Number = number; }
public void ChangeHexChit(int w, int h, EChitNumber cn) { if (_Board.Game.Board.Hexes[w, h] is RawResourceHex) { ((RawResourceHex)this._Board.Game.Board.Hexes[w, h]).XmlChit.ChitNumber = cn; } }