const Board Board::Empty() {

    Board board;

    uint counter = 0;
    for (uint i = 0; i < Dim::actual_field_count; ++i)
        board.rev_map[i] = -1;
    for (uint i = 1; i <= Dim::board_size; ++i) {
        for (uint j = 1; j <= Dim::board_size; ++j) {
            signed int field = Dim::OfPos(i, j);
            board.field_map[counter] = field;
            board.rev_map[field] = counter++;
        }
    }

    for (uint i = 0; i < Dim::actual_field_count; ++i)
        board.board[i] = board_empty;
    for (uint i = 1; i <= Dim::board_size; ++i) {
        board.board[Dim::OfPos(i, 0)] = ToFirst(root_up);
        board.board[Dim::OfPos(i, Dim::board_size + 1)] = ToFirst(root_down);
        board.board[Dim::OfPos(0, i)] = ToSecond(root_left);
        board.board[Dim::OfPos(Dim::board_size + 1, i)] = ToSecond(root_right);
    }

    board.ClearShortestPathsStats();

    return board;
}
示例#2
0
		CLogger::~CLogger(){
			auto En = this->m_pStreamList.GetEnumerator();
			for(En.ToFirst(); En.IsValid(); En.Next()){
				En.GetValue()->LogEnd(En.GetKey());
				En.GetKey()->Flush();
			}
		}
示例#3
0
		void	CLogger::Write(const Exception::CException& Exception, Log::LogLevel uLevel){
			if(!this->m_bDebugMode && uLevel == Log::LogLevel::Debug){
				return;
			}

			try{
				auto Enumerator = this->m_pStreamList.GetEnumerator();
				for(Enumerator.ToFirst(); Enumerator.IsValid(); Enumerator.Next()){

					Enumerator.GetValue()->EntryBegin(Enumerator.GetKey());
					Enumerator.GetValue()->FormatEntry(Enumerator.GetKey(), Exception, uLevel);
					Enumerator.GetValue()->EntryEnd(Enumerator.GetKey());

					if(uLevel == Log::LogLevel::Error || uLevel == Log::LogLevel::Fatal){
						Enumerator.GetKey()->Flush();
					}
				}
			}
			catch(Exception::CException&){
				return;
			}
		}