Esempio n. 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);
        }
Esempio n. 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;
     }
 }
Esempio n. 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);
            }
        }
Esempio n. 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);
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
     }
 }
Esempio n. 7
0
 public void PutBall(ZertzBallRenderer ball, HexLocation loc)
 {
     balllocs.Add(ball,loc);
     balls[loc.X,loc.Y] = ball;
 }
Esempio n. 8
0
 public void PutBall(ZertzBallRenderer ball, HexLocation loc)
 {
     balllocs.Add(ball, loc);
     balls[loc.X, loc.Y] = ball;
 }
Esempio n. 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;
 }