Ejemplo n.º 1
0
        /// <summary>
        /// 阶段初始化
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public override async Task Init(GameCommand command)
        {
            var players = command.GetGameInfo <GameInfo>().GetPlayerByIdentity(IdentityType);
            await command.GameInput.ReplyGroup(StepMessage);

            //针对组
            if (IsToGroup)
            {
                var msg = GetInitMessage(command);
                if (msg != null)
                {
                    await command.GameInput.ReplyGroup(GetInitMessage(command));
                }
            }
            else
            {
                //await command.GameInput.ReplyTemp(GetInitMessage());
                string content = GetInitMessage(command);
                foreach (var item in players)
                {
                    await command.GameInput.SendTemp(content, item.PlayerId);
                }
            }

            if ((IdentityType != IdentityType.None && players.Count() == 0) || IsEmpty(command))
            {
                await command.Empty(NextState);
            }
            else
            {
                command.IsRunNextState = false;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public async override Task Init(GameCommand command)
        {
            if (StepMessage != null)
            {
                await command.GameInput.ReplyGroup(StepMessage);
            }
            //针对组
            var msg = GetInitMessage(command);

            if (msg != null)
            {
                await command.GameInput.ReplyGroup(GetInitMessage(command));
            }

            if (IsEmpty(command))
            {
                await command.Empty(NextState);
            }
            else
            {
                command.IsRunNextState = false;
            }
        }