当前位置: 首页>>代码示例>>C#>>正文


C# Base.Cout方法代码示例

本文整理汇总了C#中Base.Cout方法的典型用法代码示例。如果您正苦于以下问题:C# Base.Cout方法的具体用法?C# Base.Cout怎么用?C# Base.Cout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Base的用法示例。


在下文中一共展示了Base.Cout方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ToHint

        public void ToHint(ushort ut, Base.VW.IVI vi,
            Func<IEnumerable<int>, string> withCode, Func<IEnumerable<int>, string> withoutCode)
        {
            bool ao = (ut > 0 && ut < 1000 && ut % 2 == 0);
            bool aka = (ut > 0 && ut < 1000 && ut % 2 == 1);
            List<int> dingR = (ao ? DingAo : DingAka).ToList();
            List<int> dingO = (ao ? DingAka : DingAo).ToList();
            List<int> banR = (ao ? BanAo : BanAka).ToList();
            List<int> banO = (ao ? BanAka : BanAo).ToList();

            if (!ao)
            {
                List<int> hinds = dingO.Intersect(Secrets).ToList();
                foreach (int h in hinds)
                {
                    dingO.Remove(h); dingO.Add(0);
                }
            }
            if (!aka)
            {
                List<int> hinds = dingR.Intersect(Secrets).ToList();
                foreach (int h in hinds)
                {
                    dingR.Remove(h); dingR.Add(0);
                }
            }

            List<int> x = Xuan.ToList();
            List<int> xhinds = x.Intersect(Secrets).ToList();
            foreach (int xh in xhinds)
            {
                x.Remove(xh); x.Add(0);
            }
            vi.Cout(ut, "当前可选角色-{0}.", withCode(x));
            if (dingR.Count > 0)
                vi.Cout(ut, "我方已选角色-{0}.", withoutCode(dingR));
            if (dingO.Count > 0)
                vi.Cout(ut, "对方已选角色-{0}.", withoutCode(dingO));
            if (banR.Count > 0)
                vi.Cout(ut, "我方已禁角色-{0}.", withoutCode(banR));
            if (banO.Count > 0)
                vi.Cout(ut, "对方已禁角色-{0}.", withoutCode(banO));
        }
开发者ID:palome06,项目名称:psd48,代码行数:43,代码来源:Casting.cs

示例2: ToInputRequire

 public void ToInputRequire(ushort ut, Base.VW.IVI vi)
 {
     vi.Cout(ut, "===> 选择您的角色{0}{1}.", Ding[ut] != 0 ? ",0为退回" : "",
          IsCaptain(ut) ? ",X为选将确定" : "");
 }
开发者ID:palome06,项目名称:psd48,代码行数:5,代码来源:Casting.cs

示例3: ConnectDoDirect

        private bool ConnectDoDirect(TcpClient client, bool watch, Base.VW.IVI vi)
        {
            NetworkStream tcpStream = client.GetStream();
            if (!watch)
                Base.VW.WHelper.SentByteLine(tcpStream, "C2CO,0," + name + "," + avatar + "," + hopeTeam);
            else
                Base.VW.WHelper.SentByteLine(tcpStream, "C2QI,0," + name);
            IDictionary<ushort, IchiPlayer> uidict = new Dictionary<ushort, IchiPlayer>();
            while (true)
            {
                string line = Base.VW.WHelper.ReadByteLine(tcpStream);
                if (line == null)
                    return false;
                else if (line.StartsWith("C2CN,") && !watch)
                {
                    ushort ut = ushort.Parse(line.Substring("C2CN,".Length));
                    if (ut == 0)
                        return false;
                    Uid = ut;
                }
                else if (line.StartsWith("C2QJ,") && watch)
                {
                    ushort ut = ushort.Parse(line.Substring("C2QJ,".Length));
                    if (ut == 0)
                        return false;
                    Uid = ut;
                }
                else if (line.StartsWith("C2RM,"))
                {
                    string[] blocks = line.Split(',');
                    for (int i = 1; i < blocks.Length; i += 3)
                    {
                        ushort ouid = ushort.Parse(blocks[i]);
                        IchiPlayer ip = new IchiPlayer()
                        {
                            Name = blocks[i + 1],
                            Avatar = int.Parse(blocks[i + 2]),
                            Uid = ouid
                        };
                        uidict.Add(ouid, ip);
                    }
                    vi.Cout(Uid, "Current other gamers: {0}", string.Join(",",
                        uidict.Values.Select(p => p.Name)));
                }
                else if (line.StartsWith("C2NW,"))
                {
                    int idx = line.IndexOf(',');
                    int jdx = line.IndexOf(',', idx + 1);
                    int kdx = line.LastIndexOf(',');

                    ushort ouid = ushort.Parse(Base.Utils.Algo.Substring(line, idx + 1, jdx));
                    IchiPlayer ip = new IchiPlayer()
                    {
                        Name = Base.Utils.Algo.Substring(line, jdx + 1, kdx),
                        Avatar = int.Parse(line.Substring(kdx + 1)),
                        Uid = ouid
                    };
                    uidict.Add(ouid, ip);
                    vi.Cout(Uid, "Newcomer: {0}", Base.Utils.Algo.Substring(line, jdx + 1, kdx));
                }
                else if (line.StartsWith("C2SA,"))
                {
                    stream = tcpStream;
                    StartListenTask(KeepOnListenRecv);
                    if (!watch)
                        StartListenTask(KeepOnListenSend);
                    return true;
                }
                else if (line.StartsWith("C"))
                    return false;
            }
        }
开发者ID:palome06,项目名称:psd48,代码行数:72,代码来源:Bywi.cs

示例4: ConnectDoDirect

        private bool ConnectDoDirect(TcpClient client, bool watch, Base.VW.IVI vi)
        {
            NetworkStream tcpStream = client.GetStream();
            VW.Cyvi cvi = vi as VW.Cyvi;
            if (!watch)
                Base.VW.WHelper.SentByteLine(tcpStream, "C2CO,0," + name + "," + avatar + "," + hopeTeam);
            else
                Base.VW.WHelper.SentByteLine(tcpStream, "C2QI,0," + name);
            IDictionary<ushort, IchiPlayer> uidict = new Dictionary<ushort, IchiPlayer>();
            while (true)
            {
                string line = Base.VW.WHelper.ReadByteLine(tcpStream);
                if (line.StartsWith("C2CN,") && !watch)
                {
                    ushort ut = ushort.Parse(line.Substring("C2CN,".Length));
                    if (ut == 0)
                        return false;
                    Uid = ut;
                    cvi.SetNick(1, name, avatar);
                }
                else if (line.StartsWith("C2QJ,") && watch)
                {
                    ushort ut = ushort.Parse(line.Substring("C2QJ,".Length));
                    if (ut == 0)
                        return false;
                    Uid = ut;
                }
                else if (line.StartsWith("C2RM,"))
                {
                    string[] blocks = line.Split(',');
                    for (int i = 1; i < blocks.Length; i += 3)
                    {
                        ushort ouid = ushort.Parse(blocks[i]);
                        IchiPlayer ip = new IchiPlayer()
                        {
                            Name = blocks[i + 1],
                            Avatar = int.Parse(blocks[i + 2]),
                            Uid = ouid
                        };
                        uidict.Add(ouid, ip);
                        cvi.SetNick(1 + uidict.Count, ip.Name, ip.Avatar);
                    }
                }
                else if (line.StartsWith("C2NW,"))
                {
                    int idx = line.IndexOf(',');
                    int jdx = line.IndexOf(',', idx + 1);
                    int kdx = line.LastIndexOf(',');

                    ushort ouid = ushort.Parse(Algo.Substring(line, idx + 1, jdx));
                    IchiPlayer ip = new IchiPlayer()
                    {
                        Name = Algo.Substring(line, jdx + 1, kdx),
                        Avatar = int.Parse(line.Substring(kdx + 1)),
                        Uid = ouid
                    };
                    uidict.Add(ouid, ip);
                    cvi.SetNick(1 + uidict.Count, ip.Name, ip.Avatar);
                    vi.Cout(Uid, "Newcomer: {0}", Algo.Substring(line, jdx + 1, kdx));
                }
                else if (line.StartsWith("C2SA,"))
                {
                    stream = tcpStream;
                    recvThread = new Thread(() => ZI.SafeExecute(() => KeepOnListenRecv(),
                        delegate(Exception e) { Log.Logg(e.ToString()); }));
                    recvThread.Start();
                    if (!watch)
                    {
                        sendThread = new Thread(() => ZI.SafeExecute(() => KeepOnListenSend(),
                            delegate(Exception e) { Log.Logg(e.ToString()); }));
                        sendThread.Start();
                    }
                    return true;
                }
                else if (line.StartsWith("C"))
                    return false;
            }
        }
开发者ID:palome06,项目名称:psd48,代码行数:78,代码来源:Bywi.cs


注:本文中的Base.Cout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。