Exemplo n.º 1
0
        public bool equals(PokerstarsNoteNote otherPsNote)
        {
            bool equal = false;

            if ((this._text.Equals(otherPsNote.getText())) && (this._playerName.Equals(otherPsNote.getPlayerName())) && (this._label.Equals(otherPsNote.getLabel())) && (this._updateDate.Equals((otherPsNote.getUpdateDate()))))
            {
                equal = true;
            }
            return(equal);
        }
Exemplo n.º 2
0
        private int startCompare()
        {
            string foreign_playername;
            int    own_durchlauf, foreign_durchlauf;
            bool   vorhanden;
            int    angehaengteNotesCounter = 0;

            foreign_durchlauf = 0;
            if (_ownNote.getPokerstarsNotes().Length > _foreignNote.getPokerstarsNotes().Length)
            {
                _convMergedNotes = new PokerstarsNoteNote[_ownNote.getPokerstarsNotes().Length]; //deklaration der Merged Notes Variable Größe = Größe der own_notes
            }
            else
            {
                _convMergedNotes = new PokerstarsNoteNote[_foreignNote.getPokerstarsNotes().Length]; //deklaration der Merged Notes Variable Größe der foreign_notes
            }
            do
            {
                vorhanden          = false;
                foreign_playername = _foreignNote.getPokerstarsNotes()[foreign_durchlauf].getPlayerName();
                own_durchlauf      = 0;
                do
                {
                    string own_playername;
                    own_playername = _ownNote.getPokerstarsNotes()[own_durchlauf].getPlayerName();
                    if (foreign_playername == own_playername)
                    {
                        vorhanden = true;
                    }
                    own_durchlauf++;
                } while ((own_durchlauf < _ownNote.getPokerstarsNotes().Length) && (vorhanden != true));
                if (vorhanden == false)
                {
                    _convMergedNotes[angehaengteNotesCounter] = new PokerstarsNoteNote();
                    _convMergedNotes[angehaengteNotesCounter].setText(_foreignNote.getPokerstarsNotes()[foreign_durchlauf].getText());
                    _convMergedNotes[angehaengteNotesCounter].setUpdateDate(_foreignNote.getPokerstarsNotes()[foreign_durchlauf].getUpdateDate());
                    _convMergedNotes[angehaengteNotesCounter].setLabel("-1");
                    _convMergedNotes[angehaengteNotesCounter].setPlayerName(_foreignNote.getPokerstarsNotes()[foreign_durchlauf].getPlayerName());
                    angehaengteNotesCounter++;
                }
                foreign_durchlauf++;
            } while (foreign_durchlauf < _foreignNote.getPokerstarsNotes().Length);
            return(angehaengteNotesCounter);
        }
Exemplo n.º 3
0
        public void compareNotes(string path2ownNotes, string path2foreignNotes, string path2newNotes)
        {
            int _angehaengteNotesCounter;

            _xmlNotesWriter = new XMLNotesWriter();

            openNotes(path2ownNotes, path2foreignNotes);
            _angehaengteNotesCounter = startCompare();

            //anhängen der conv_merged_notes an die conv_own_notes => als ergebniss kommen die conv_final_notes raus
            _convFinalNotes = new PokerstarsNoteNote[_ownNote.getPokerstarsNotes().Length + _angehaengteNotesCounter];
            for (int i = 0; i < _ownNote.getPokerstarsNotes().Length; ++i)
            {
                _convFinalNotes[i] = _ownNote.getPokerstarsNotes()[i];
            }
            for (int i = 0; i < _angehaengteNotesCounter; ++i)
            {
                _convFinalNotes[i + _ownNote.getPokerstarsNotes().Length] = _convMergedNotes[i];
            }

            //******************************************Start der Writing Engine******************************************//
            _xmlNotesWriter.writeNewNotes(_ownNote.getPokerstarsLabels(), _convFinalNotes, path2newNotes, _ownNote, _angehaengteNotesCounter);
        }
Exemplo n.º 4
0
        /*
         * @param selection - can be own or foreign
         */
        private PokerstarsNoteNote[] fillConvNotes(string selection, string notesText)
        {
            int     note_start = 0;
            int     note_end = 0;
            string  temp, temp_char;
            Boolean stop;
            int     workPos, iiiiiiiii;

            PokerstarsNoteNote[] conv_notes;
            int note_iterator = 0;
            int notecounter;

            notecounter = countNotes(notesText);

            //erstellen des note arrays in Abhänigkeit von der Anzahl der Notes
            conv_notes = new PokerstarsNoteNote[notecounter];

            while ((note_start >= 0) && (note_end >= 0))
            {
                note_start = notesText.IndexOf("<note ", 0);
                note_end   = notesText.IndexOf("</note>", 0);
                if ((note_start != -1) && (note_end != -1))
                {
                    conv_notes[note_iterator] = new PokerstarsNoteNote();
                    temp      = notesText.Substring(note_start, ((note_end - note_start) + 8));
                    iiiiiiiii = 0;
                    workPos   = 6;
                    stop      = false;
                    while ((temp.Substring(workPos, 3) == "upd") || (temp.Substring(workPos, 3) == "lab") || (temp.Substring(workPos, 3) == "pla") || ((temp.Substring((workPos - 2), 2) == "\">") && (iiiiiiiii == 2)))
                    {
                        stop = false;
                        switch (temp.Substring(workPos, 3))
                        {
                        //einlesen des update-datums der note
                        case "upd":
                            workPos += 8;
                            conv_notes[note_iterator].setUpdateDate(temp.Substring(workPos, 10));     //einlesen des letzten update-datums
                            workPos += 13;
                            break;

                        //einlesen der label-id der note
                        case "lab":
                            workPos += 7;
                            do
                            {
                                temp_char = temp.Substring(workPos, 1);
                                if (temp_char == "\"")
                                {
                                    stop = true;
                                }
                                else
                                {
                                    conv_notes[note_iterator].setLabel(conv_notes[note_iterator].getLabel() + temp_char);
                                }
                                workPos++;
                            }while (stop == false);
                            iiiiiiiii++;
                            workPos++;
                            break;

                        //einlesen des player-name
                        case "pla":
                            workPos += 8;
                            do
                            {
                                temp_char = temp.Substring(workPos, 1);
                                if (temp_char == "\"")
                                {
                                    stop = true;
                                }
                                else
                                {
                                    conv_notes[note_iterator].setPlayerName(conv_notes[note_iterator].getPlayerName() + temp_char);
                                }
                                workPos++;
                            }while (stop == false);
                            iiiiiiiii++;
                            workPos++;
                            break;

                        default:
                            workPos++;
                            break;
                        }
                    }
                    if (iiiiiiiii == 2)
                    {
                        workPos--;
                    }
                    conv_notes[note_iterator].setText(conv_notes[note_iterator].getText() + temp.Substring(workPos, (temp.Length - workPos - 8))); //einlesen der eigentlichen note

                    note_iterator++;
                    notesText = notesText.Remove(note_start, ((note_end - note_start) + 7)); //löscht die aktuelle Note aus notes
                }
            }
            return(conv_notes);
        }