2022-09-08 08:04:32 -07:00

134 lines
3.1 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace WebAPI.Models.IceBreak
{
public enum GameType
{
WereWolf,
WhoIsSpy
}
public class GameRoom
{
GameType Type { get; set; }
public string Id { get; set; }
private List<WhoIsSpyPlayer> _players;
public int TotalPlayer => Players.Count;
public List<WhoIsSpyPlayer> Players
{
get
{
if (_players == null)
{
_players = new List<WhoIsSpyPlayer>();
}
return _players;
}
set => _players = value;
}
}
public class GamePlayer
{
public string Id { get; set; }
[Required]
public string Name { get; set; }
public string TempGameRoomId { get; set; }
}
public enum WhoIsSpyProcess
{
WaitForPlayer,
Started,
Votting,
DisplayResult,
End,
Closed
}
public class WhoIsSpyGameRoom : GameRoom
{
public WhoIsSpyGameRoom()
{
PlayedAnswerId = new List<int>();
}
public int Question { get; set; }
[Required]
public int SpyAmount { get; set; }
[Required]
public int EmptyAmount { get; set; }
public int StartIndex { get; set; }
public WhoIsSpyAnswer Answer { get; set; }
public WhoIsSpyAnswer SpysAnswer { get; set; }
public WhoIsSpyProcess Status { get; set; }
public List<int> PlayedAnswerId { get; set; }
public int VoteAmount { get; set; }
}
public class WhoIsSpyPlayer
{
public string Id { get; set; }
public string RoomId { get; set; }
public int Seed { get; set; }
public string Name { get; set; }
public WhoIsSpyAnswer Answer { get; set; }
public bool IsSpy { get; set; }
public bool IsDead { get; set; }
public WhoIsSpyProcess GameStatus { get; set; }
public List<string> VoteTo { get; set; }
public int ReceviedVotes { get; set; }
public int VoteAmount { get; set; }
public List<WhoIsSpyVoteOption> VoteOption { get; set; }
}
public class WhoIsSpyVoteOption
{
public WhoIsSpyVoteOption(string id, string name)
{
Id = id;
Name = name;
}
public string Id { get; set; }
public string Name { get; set; }
}
public class WhoIsSpyAnswer
{
public WhoIsSpyAnswer()
{
}
public WhoIsSpyAnswer(string answerCht, string answerChs, string answerEn, string answerImage)
{
AnswerCht = answerCht;
AnswerChs = answerChs;
AnswerEn = answerEn;
AnswerImage = answerImage;
}
public string AnswerCht { get; set; }
public string AnswerChs { get; set; }
public string AnswerEn { get; set; }
public string AnswerImage { get; set; }
}
}