示例#1
0
        public ZertzBallRenderer RemoveBall(HexLocation loc)
        {
            ZertzBallRenderer zbr = balls[loc.X, loc.Y];

            balllocs.Remove(zbr);
            balls[loc.X, loc.Y] = null;
            return(zbr);
        }
示例#2
0
 public Vector3 Add(ZertzBallRenderer zbr)
 {
     lock(this.balls) {
         Vector3 v = GetNextPosition(zbr.Type);
         switch(zbr.Type) {
             case ZertzBallType.Black :
                 this.black++;
                 break;
             case ZertzBallType.Gray :
                 this.gray++;
                 break;
             case ZertzBallType.White :
                 this.white++;
                 break;
         }
         this.balls.Add(zbr);
         return v;
     }
 }
示例#3
0
        public void Remove(ZertzBallRenderer zbr)
        {
            lock (this.balls) {
                zbr.Container = ZertzBallContainerType.None;
                switch (zbr.Type)
                {
                case ZertzBallType.Black:
                    this.black--;
                    break;

                case ZertzBallType.Gray:
                    this.gray--;
                    break;

                case ZertzBallType.White:
                    this.white--;
                    break;
                }
                this.balls.Remove(zbr);
            }
        }
示例#4
0
        public static ZertzBallRenderer[] GenerateBalls(ZertzBallContainer zbc, RenderContainer rc, ZertzCupRenderer zcr, int offsetid)
        {
            int               id = offsetid;
            ZertzBallType     zbt;
            ZertzBallRenderer zbr;

            ZertzBallRenderer[] list = new ZertzBallRenderer[zbc.Total];
            int j = 0x00;

            for (byte b = 0x00; b < 0x03; b++)
            {
                zbt = (ZertzBallType)b;
                for (int i = 0x00; i < zbc[zbt]; i++)
                {
                    zbr       = new ZertzBallRenderer(zbt);
                    list[j++] = zbr;
                    rc.Add(id++, zbr);
                    zbr.RenderMover = RenderMoveManager.GenerateStaticMover(zcr.CommonContainer.Add(zbr));
                }
            }
            return(list);
        }
示例#5
0
        public Vector3 Add(ZertzBallRenderer zbr)
        {
            lock (this.balls) {
                Vector3 v = GetNextPosition(zbr.Type);
                switch (zbr.Type)
                {
                case ZertzBallType.Black:
                    this.black++;
                    break;

                case ZertzBallType.Gray:
                    this.gray++;
                    break;

                case ZertzBallType.White:
                    this.white++;
                    break;
                }
                this.balls.Add(zbr);
                return(v);
            }
        }
示例#6
0
 public void Remove(ZertzBallRenderer zbr)
 {
     lock(this.balls) {
         zbr.Container = ZertzBallContainerType.None;
         switch(zbr.Type) {
             case ZertzBallType.Black :
                 this.black--;
                 break;
             case ZertzBallType.Gray :
                 this.gray--;
                 break;
             case ZertzBallType.White :
                 this.white--;
                 break;
         }
         this.balls.Remove(zbr);
     }
 }
示例#7
0
 public void PutBall(ZertzBallRenderer ball, HexLocation loc)
 {
     balllocs.Add(ball,loc);
     balls[loc.X,loc.Y] = ball;
 }
示例#8
0
 public void PutBall(ZertzBallRenderer ball, HexLocation loc)
 {
     balllocs.Add(ball, loc);
     balls[loc.X, loc.Y] = ball;
 }
示例#9
0
 public static ZertzBallRenderer[] GenerateBalls(ZertzBallContainer zbc, RenderContainer rc, ZertzCupRenderer zcr, int offsetid)
 {
     int id = offsetid;
     ZertzBallType zbt;
     ZertzBallRenderer zbr;
     ZertzBallRenderer[] list = new ZertzBallRenderer[zbc.Total];
     int j = 0x00;
     for(byte b = 0x00; b < 0x03; b++) {
         zbt = (ZertzBallType) b;
         for(int i = 0x00; i < zbc[zbt]; i++) {
             zbr = new ZertzBallRenderer(zbt);
             list[j++] = zbr;
             rc.Add(id++,zbr);
             zbr.RenderMover = RenderMoveManager.GenerateStaticMover(zcr.CommonContainer.Add(zbr));
         }
     }
     return list;
 }