/*******************************************************************************
 * Copyright (c) 2024-2025 R3944Realms. All rights reserved.
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 *     http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/

package com.r3944realms.dg_lab.manager;

import com.r3944realms.dg_lab.api.manager.Status;
import com.r3944realms.dg_lab.websocket.PowerBoxWSClient;
import com.r3944realms.dg_lab.api.websocket.message.Message;
import com.r3944realms.dg_lab.websocket.sharedData.ClientPowerBoxSharedData;

/**
 * The type Dgpb client manager.
 */
public class DGPBClientManager implements IDGLabManager {
    /**
     * The Client.
     */
    protected final PowerBoxWSClient client;

    /**
     * Instantiates a new Dgpb client manager.
     *
     * @param client the client
     */
    public DGPBClientManager(PowerBoxWSClient client) {
        this.client = client;
    }
    @Override
    public void start() {
        client.start();
    }

    @Override
    public void stop() {
        client.stop();
    }

    @Override
    public ClientPowerBoxSharedData getSharedData() {
        return client.getSharedData();
    }

    @Override
    public Status getStatus() {
        return client.getStatus();
    }

    @Override
    public void setStatus(Status status) {
        client.setStatus(status);
    }

    /**
     * Sets address.
     *
     * @param address the address
     */
    public void setAddress(String address) {
        client.setAddress(address);
    }

    /**
     * Sets port.
     *
     * @param port the port
     */
    public void setPort(int port) {
        client.setPort(port);
    }

    /**
     * Sets address and port.
     *
     * @param address the address
     * @param port    the port
     */
    public void setAddressAndPort(String address, int port) {
        client.setAddressAndPort(address, port);
    }

    /**
     * Send.
     *
     * @param message the message
     */
    public void send(Message message) {
        client.send(message);
    }
}
