C# 클래스 BattleShip.FileManager

파일 보기 프로젝트 열기: LucienCamuglia/Battleships 1 사용 예제들

공개 메소드들

메소드 설명
FileManager ( string path, string pseudo ) : System

Constructor for creating new game

FileManager ( string path, string pseudo, string filename ) : System

Constructor for joining a game

ReadCurrentPlayer ( ) : string
ReadPlayers ( ) : string[]

Read the both players

SwitchCurrentPlayer ( ) : void
WriteBattleBoard ( int x, int y, int value ) : void

readBoard ( string boardType, string player ) : ].int[
writeBoard ( string boardType, string player, int x, int y, int value ) : void

비공개 메소드들

메소드 설명
ChangeFileStatus ( bool _lock ) : void

lock or unlock the bnav file The lock work with a copy of the original file with '.lock' at the end. - ex 'BN-V02-2016-01-02-14-20-50.bnav.lock' To unlock the original file the '.lock' file is deleted

CreateFiles ( string myPath ) : void

Create the BNAV file for the game

JoinGame ( string path, string filename, string pseudo ) : bool

Join a curent game

fileIsLocked ( ) : bool

Check if the file is locked

writePseudo ( string player, string pseudo ) : void

Write the pseudo of the player in the file

메소드 상세

FileManager() 공개 메소드

Constructor for creating new game
public FileManager ( string path, string pseudo ) : System
path string
pseudo string
리턴 System

FileManager() 공개 메소드

Constructor for joining a game
public FileManager ( string path, string pseudo, string filename ) : System
path string
pseudo string
filename string
리턴 System

ReadCurrentPlayer() 공개 메소드

public ReadCurrentPlayer ( ) : string
리턴 string

ReadPlayers() 공개 메소드

Read the both players
public ReadPlayers ( ) : string[]
리턴 string[]

SwitchCurrentPlayer() 공개 메소드

public SwitchCurrentPlayer ( ) : void
리턴 void

WriteBattleBoard() 공개 메소드

public WriteBattleBoard ( int x, int y, int value ) : void
x int
y int
value int
리턴 void

readBoard() 공개 메소드

public readBoard ( string boardType, string player ) : ].int[
boardType string
player string
리턴 ].int[

writeBoard() 공개 메소드

public writeBoard ( string boardType, string player, int x, int y, int value ) : void
boardType string
player string
x int
y int
value int
리턴 void