1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-29 09:44:52 +01:00
Files
OpenRCT2/src/openrct2/network/NetworkGroup.h
2019-03-17 07:16:15 +00:00

41 lines
1.0 KiB
C++

/*****************************************************************************
* Copyright (c) 2014-2019 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
#include "../common.h"
#include "NetworkPacket.h"
#include <array>
#include <jansson.h>
#include <string>
class NetworkGroup final
{
public:
std::array<uint8_t, 8> ActionsAllowed{};
uint8_t Id = 0;
static NetworkGroup FromJson(const json_t* json);
const std::string& GetName() const;
void SetName(std::string name);
void Read(NetworkPacket& packet);
void Write(NetworkPacket& packet);
void ToggleActionPermission(size_t index);
bool CanPerformAction(size_t index) const;
bool CanPerformCommand(int32_t command) const;
json_t* ToJson() const;
private:
std::string _name;
};