资源简介

Silverlight+WCF 实战-网络象棋源码 1。按钮事件”求和、认输、返回大厅、退出系统“ 2。棋谱及棋谱回放,能过该回放能定义棋子自动回放,并可定义棋子每步的间隔时间。 3。在线用户 4。聊天窗口。

资源截图

代码片段和文件信息

using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace ChessNewInstance
{
    /// 
    /// 棋盘 by 路过秋天
    /// http://cyq1162.cnblogs.com
    /// 

    public class Board
    {
        /// 
        /// 十字轨迹框
        /// 

        public Canvas TrackFrom
        {
            get;
            set;
        }
        /// 
        /// 十字轨迹框
        /// 

        public Canvas TrackTo
        {
            get;
            set;
        }
        /// 
        /// 棋盘Left偏移量
        /// 

        public int marginLeft = 50;
        /// 
        /// 棋盘Top偏移量
        /// 

        public int marginTop = 50;
        /// 
        /// 棋盘隔宽
        /// 

        public int gap = 50;
        private int minGap = 5;//修饰隔宽
        Panel container;
        public double Width
        {
            get;
            set;
        }
        public double Height
        {
            get;
            set;
        }
        public void DrawIn(Panel control)
        {
            Width = gap * 9 + marginLeft;
            Height = gap * 10 + marginTop;
            container = control;
            container.Width = Width;
            container.Height = Height;
            Draw();
        }
        private void Draw()
        {
            //画横线
            for (int i = 0; i < 10; i++)
            {
                DrawLine(0 i 8 i);
            }
            //画7条直线,两边另外补
            for (int j = 1; j < 8; j++)
            {
                DrawLine(j 0 j 4);
            }
            for (int k = 1; k < 8; k++)
            {
                DrawLine(k 5 k 9);
            }
            //补上两边两条直线
            DrawLine(0 0 0 9);
            DrawLine(8 0 8 9);
            //画交叉线
            DrawLine(3 0 5 2);
            DrawLine(3 2 5 0);
            DrawLine(3 7 5 9);
            DrawLine(3 9 5 7);
            //画修饰线[炮]
            DrawLine4(1 2);
            DrawLine4(1 7);
            DrawLine4(7 2);
            DrawLine4(7 7);
            //画修饰线[兵]
            DrawLine4(2 3);
            DrawLine4(4 3);
            DrawLine4(6 3);

            DrawLine4(2 6);
            DrawLine4(4 6);
            DrawLine4(6 6);

            DrawLineLeft2(8 3);
            DrawLineLeft2(8 6);
            DrawLineRight2(0 3);
            DrawLineRight2(0 6);
           
            #region 画棋步轨迹
            //创建两个十字修饰框
            TrackFrom = new Canvas()
            {
                Width = gap
                Height = gap
                Margin = new Thickness(-marginLeft * 12 -marginLeft * 12 0 0)
 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      23040  2011-06-21 10:18  SilverlightChess\ChessNewInstance\Bin\Debug\ChessNewInstance.dll

     文件      42496  2011-06-21 10:18  SilverlightChess\ChessNewInstance\Bin\Debug\ChessNewInstance.pdb

     目录          0  2011-06-21 09:59  SilverlightChess\ChessNewInstance\Bin\Debug

     目录          0  2011-06-21 09:58  SilverlightChess\ChessNewInstance\Bin

     文件       6970  2010-10-11 10:03  SilverlightChess\ChessNewInstance\Board.cs

     文件      10717  2010-10-11 09:17  SilverlightChess\ChessNewInstance\Chess.cs

     文件       4767  2011-06-21 10:16  SilverlightChess\ChessNewInstance\ChessAction.cs

     文件       5129  2010-07-28 09:19  SilverlightChess\ChessNewInstance\Chessman.cs

     文件       3655  2010-07-09 12:32  SilverlightChess\ChessNewInstance\ChessNewInstance.csproj

     文件       1142  2010-07-09 12:32  SilverlightChess\ChessNewInstance\ChessNewInstance.csproj.user

     文件       9142  2010-08-09 10:09  SilverlightChess\ChessNewInstance\ChessRule.cs

     文件        535  2011-06-21 09:59  SilverlightChess\ChessNewInstance\obj\Debug\ChessNewInstance.csproj.FileListAbsolute.txt

     文件      23040  2011-06-21 10:18  SilverlightChess\ChessNewInstance\obj\Debug\ChessNewInstance.dll

     文件      42496  2011-06-21 10:18  SilverlightChess\ChessNewInstance\obj\Debug\ChessNewInstance.pdb

     文件       5489  2011-06-21 10:31  SilverlightChess\ChessNewInstance\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     目录          0  2011-06-21 09:58  SilverlightChess\ChessNewInstance\obj\Debug\TempPE

     目录          0  2011-06-21 10:18  SilverlightChess\ChessNewInstance\obj\Debug

     目录          0  2011-06-21 09:58  SilverlightChess\ChessNewInstance\obj

     文件       1352  2010-07-06 16:54  SilverlightChess\ChessNewInstance\Properties\AssemblyInfo.cs

     目录          0  2010-07-06 16:54  SilverlightChess\ChessNewInstance\Properties

     目录          0  2011-06-21 09:58  SilverlightChess\ChessNewInstance

     文件       2590  2010-07-14 15:27  SilverlightChess\ChessNewInstance.sln

    ..A..H.     94720  2011-06-21 10:31  SilverlightChess\ChessNewInstance.suo

     目录          0  2010-07-14 14:02  SilverlightChess\GameService\App_Data

     文件      12800  2011-06-21 10:18  SilverlightChess\GameService\bin\GameService.dll

     文件      26112  2011-06-21 10:18  SilverlightChess\GameService\bin\GameService.pdb

     文件     186240  2010-08-26 02:37  SilverlightChess\GameService\bin\System.ServiceModel.PollingDuplex.dll

     目录          0  2011-06-21 09:59  SilverlightChess\GameService\bin

     文件        318  2010-07-14 15:52  SilverlightChess\GameService\clientaccesspolicy.xml

     文件       1538  2010-07-30 15:41  SilverlightChess\GameService\DataContract\MoveStep.cs

............此处省略250个文件信息

评论

共有 条评论