C# 클래스 MBC.App.WPF.FieldControl

The FieldControl class is a WPF control that graphically displays the state of a Field object. The FieldControl must be given the IBattleshipController index that is being displayed on this Field. Usage of this class is simple by utilizing three class members: SetController(int) - Sets the controller index in a Field. SetField(Field) - Sets the Field to display. UpdateFieldDisplay() - Updates the FieldControl to display the Field's current state.
상속: System.Windows.Controls.UserControl
파일 보기 프로젝트 열기: aiclub/Mohawk_Battleship

공개 프로퍼티들

프로퍼티 타입 설명
ControllerColorProperty System.Windows.DependencyProperty

공개 메소드들

메소드 설명
SetController ( int ibc ) : void
UpdateFieldDisplay ( ) : void

비공개 메소드들

메소드 설명
CreateShips ( ) : void

Creates the graphics that represent the ships that will be displayed. Internally used.

FieldControl ( ) : System
FieldLoaded ( object sender, RoutedEventArgs e ) : void

Invoked when the FieldControl has been loaded into the WPF interface.

LayShips ( ) : void

Sets the Rectangle objects that represent the ships that will be displayed. Internally used.

LayShots ( ) : void

Sets the Ellipse objects that represent the opponent controller's shots which will be displayed on the grid. Internally used.

MakeGrid ( int rows, int cols ) : void

Generates the WPF grid with a specified number of rows and columns. Internally used.

메소드 상세

SetController() 공개 메소드

public SetController ( int ibc ) : void
ibc int
리턴 void

UpdateFieldDisplay() 공개 메소드

public UpdateFieldDisplay ( ) : void
리턴 void

프로퍼티 상세

ControllerColorProperty 공개적으로 정적으로 프로퍼티

The Color property that this FieldControl uses to display a certain controller.
public static DependencyProperty,System.Windows ControllerColorProperty
리턴 System.Windows.DependencyProperty