Package com.poker.data

Source Code of com.poker.data.PokerData

package com.poker.data;

import java.awt.Point;
import java.util.ArrayList;
import java.util.List;

import com.poker.ui.settings.ComputerSetting;
import com.poker.ui.settings.ProgramSettings;
import com.poker.ui.settings.RoomSettings;
import com.poker.ui.settings.rooms.ParimatchSettings;
import com.poker.ui.windows.MainWindow;
import com.poker.ui.windows.PlayWindow;
import com.poker.ui.windows.auxiluary.WindowPosition;

public class PokerData {

    MainWindow           mainWnd;
    RoomSettings         roomSettings;
    ComputerSetting      computerSettings;
    ProgramSettings      programSettings;

    Integer              procID         = null;

    public Boolean       bSyncVariable  = true;
    public Boolean       bNeedNewTables = false;

    List<WindowPosition> windowsPos;
    List<PlayWindow>     waitingWindowList;

    public PokerData() {

        this.windowsPos = new ArrayList<WindowPosition>();
        this.waitingWindowList = new ArrayList<PlayWindow>();

        this.roomSettings = new ParimatchSettings();

        this.computerSettings = new ComputerSetting();
        this.programSettings = new ProgramSettings(this.computerSettings, this.roomSettings, 2, 2);

        PreparePositions();

    }

    void PreparePositions() {

        WindowPosition wpos;
        for (int j = 0; j < this.programSettings.getNumPositionRows(); j++) {
            for (int i = 0; i < this.programSettings.getNumPositionCols(); i++) {
                wpos = new WindowPosition();
                wpos.setX(i);
                wpos.setY(j);
                wpos.setPosNum(i + j * this.programSettings.getNumPositionCols());
                wpos.setPlayWindow(null);
                this.windowsPos.add(wpos);
            }
        }
    }

    public MainWindow getMainWnd() {

        return this.mainWnd;
    }

    public void setMainWnd(final Integer hWnd, final Point ptleftTop) {

        if (hWnd == 0) {
            this.mainWnd = null;
        } else {
            this.mainWnd = new MainWindow(hWnd);
            this.mainWnd.setLeftTop(ptleftTop);
        }

    }

    public RoomSettings getRoomSettings() {

        return this.roomSettings;
    }

    public ComputerSetting getComputerSettings() {

        return this.computerSettings;
    }

    public ProgramSettings getProgramSettings() {

        return this.programSettings;
    }

    public List<WindowPosition> getWindowsPos() {

        return this.windowsPos;
    }

    public List<PlayWindow> getWaitingWindowList() {

        return this.waitingWindowList;
    }

    public Integer getProcID() {

        return this.procID;
    }

    public void setProcID(final Integer procID) {

        this.procID = procID;
    }

}
TOP

Related Classes of com.poker.data.PokerData

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.