Exemplo n.º 1
0
    public async UniTask CreatePlayers()
    {
        var oppoPlaceCounter = 1;

        //oppo place starts at 1 to 3

        for (int i = 0; i < RoomSettings.I.Capacity; i++)
        {
            PlayerBase player = null;
            if (RoomSettings.I.MyTurn == i)
            {
                player = await PlayerBase.Create(RoomSettings.I.UserInfos[i].SelectedCardback, 0,
                                                 i);

                Players.Add(player);
                MyPlayer = player as IPlayer;
            }
            else
            {
                player = await PlayerBase.Create(RoomSettings.I.UserInfos[i].SelectedCardback,
                                                 oppoPlaceCounter ++, i);

                Players.Add(player);
                Oppos.Add(player as IOppo);
            }
        }
    }
Exemplo n.º 2
0
        public IEnumerator AutoThrow() => UniTask.ToCoroutine(async() =>
        {
            await LoadEss();

            RoomReferences.I = new RoomReferences
            {
                Canvas = canvas, Root = new GameObject().transform
            };
            RoomSettings.I = new RoomSettings(0, 0, fullUserInfos.ToList(), 0);

            new RoomUserView.Manager();
            RoomUserView.Manager.I.Init();

            Controller.I   = new Mock <IController>().Object;
            CoreGameplay.I = new Mock <ICoreGameplay>().Object;
            await Ground.Create();

            var oppo = await PlayerBase.Create(0, 1, 0) as IOppo;
            await oppo.Distribute();

            Ground.I.Distribute(new List <int> {
                1, 2, 3, 4
            });

            oppo.Throw(new ThrowResult {
                ThrownCard = 5, EatenCardsIds = new List <int>()
            });
            await UniTask.Delay(2000);
            oppo.Throw(new ThrowResult {
                ThrownCard = 5, EatenCardsIds = new List <int>()
            });
            await UniTask.Delay(2000);
            oppo.Throw(new ThrowResult {
                ThrownCard = 5, EatenCardsIds = new List <int>()
            });
            await UniTask.Delay(2000);
            oppo.Throw(new ThrowResult {
                ThrownCard = 5, EatenCardsIds = new List <int>()
            });
            await UniTask.Delay(2000);
        });