2020-02-13 19:46:00 +01:00
|
|
|
/*
|
|
|
|
Connect four - written in java
|
|
|
|
Copyright (C) 2020 Oliver Schappacher and Dorian Zedler
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2020-02-05 15:01:40 +01:00
|
|
|
package de.itsblue.ConnectFour;
|
|
|
|
|
2020-02-14 19:21:49 +01:00
|
|
|
import javax.swing.*;
|
2020-02-05 15:01:40 +01:00
|
|
|
|
2020-02-14 19:21:49 +01:00
|
|
|
import java.awt.*;
|
2020-02-05 15:29:52 +01:00
|
|
|
|
2020-02-14 19:21:49 +01:00
|
|
|
public class Plate {
|
2020-02-05 15:01:40 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
2020-02-14 19:21:49 +01:00
|
|
|
/**
|
|
|
|
* Enum containing all plate types
|
|
|
|
*/
|
2020-02-05 15:29:52 +01:00
|
|
|
enum PlateType {
|
|
|
|
X, O
|
|
|
|
}
|
|
|
|
|
2020-02-14 19:21:49 +01:00
|
|
|
/**
|
|
|
|
* The tpe of the plate object
|
|
|
|
*/
|
2020-02-05 15:29:52 +01:00
|
|
|
private PlateType type;
|
|
|
|
|
2020-02-14 19:21:49 +01:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
* @param type type of the plate
|
|
|
|
*/
|
2020-02-05 15:29:52 +01:00
|
|
|
Plate(PlateType type) {
|
|
|
|
this.setType(type);
|
|
|
|
}
|
|
|
|
|
2020-02-14 19:21:49 +01:00
|
|
|
/**
|
|
|
|
* Function to get the type of the plate
|
|
|
|
* @return PlateType
|
|
|
|
*/
|
2020-02-11 21:46:24 +01:00
|
|
|
public PlateType getType() {
|
2020-02-14 19:21:49 +01:00
|
|
|
return this.type;
|
2020-02-05 15:29:52 +01:00
|
|
|
}
|
|
|
|
|
2020-02-14 19:21:49 +01:00
|
|
|
/**
|
|
|
|
* Function to change the type of the plate
|
|
|
|
*
|
|
|
|
* @param type the type to set the plate to
|
|
|
|
*/
|
2020-02-05 15:29:52 +01:00
|
|
|
private void setType(PlateType type) {
|
|
|
|
this.type = type;
|
2020-02-05 15:01:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|