C# Класс BattleShip.FileManager

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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