2023-03-06 10:06:43 +04:00
|
|
|
/*
|
2024-05-09 10:50:59 +03:00
|
|
|
* Copyright 2023-2024 Eduard Kargin <kargin.eduard@gmail.com>
|
2023-03-06 10:06:43 +04:00
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
|
*
|
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace Ragon.Client
|
|
|
|
|
{
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class RagonPlayer
|
|
|
|
|
{
|
|
|
|
|
public string Id { get; private set; }
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
public ushort PeerId { get; set; }
|
|
|
|
|
public bool IsRoomOwner { get; set; }
|
2023-05-07 12:46:39 +03:00
|
|
|
public bool IsLocal { get; set; }
|
2024-05-09 10:50:59 +03:00
|
|
|
public IUserData UserData { get; private set; }
|
2024-04-14 08:49:30 +03:00
|
|
|
|
2023-05-07 12:46:39 +03:00
|
|
|
public RagonPlayer(ushort peerId, string playerId, string name, bool isRoomOwner, bool isLocal)
|
2023-03-06 10:06:43 +04:00
|
|
|
{
|
|
|
|
|
PeerId = peerId;
|
|
|
|
|
IsRoomOwner = isRoomOwner;
|
2023-05-07 12:46:39 +03:00
|
|
|
IsLocal = isLocal;
|
2023-03-06 10:06:43 +04:00
|
|
|
Name = name;
|
|
|
|
|
Id = playerId;
|
2024-05-09 10:50:59 +03:00
|
|
|
UserData = isLocal ? new RagonUserData() : new RagonUserDataReadOnly();
|
2024-04-14 19:07:48 +03:00
|
|
|
}
|
2023-03-06 10:06:43 +04:00
|
|
|
}
|
|
|
|
|
}
|