---
# System prepended metadata

title: Einstieg OOP mit TicTacToe
tags: [Programmierung]

---

# Einstieg OOP mit TicTacToe

Vorgehen bei Tic Tac Toe:

1. UML erstelle

```plantuml
skinparam style strictuml
skinparam class {
    BackgroundColor white
    ArrowColor gray
    BorderColor black
}

class Player
{
    - name: string
    - sign: char
    - number: int
    + setName(string)
    + getName(): string
    + setSign(char)
    + getSign(): char
    + setNumber(int)
    + getNumber(): int
}

class TicTacToe {
    - player1: Player
    - player2: Player
    - board: Board
    - currentPlayer:
    + setPlayer1(Player)
    + getPlayer1(): Player
    + setPlayer2(Player)
    + getPlayer2(): Player
    + setBoard(Board)
    + getBoard(): Board
    + changePlayer()
    + start()
    + reset()
    + getcurrentPlayer(): Player
    
}

class Board {
    - array[1..9]
    + checkWin(Player): boolean
    + checkTie(): boolean
    + set(int, Player)
    + get(int): Player
    + reset()
}

```
