コード例 #1
0
        public void PutBall(ZertzBallContainerType containertype, ZertzBallType type, HexLocation location)
        {
            ZertzContainerRenderer zbcr = this.zcr[containertype];
            ZertzBallRenderer      zbr  = zbcr.GetBallOfType(type);

            zbcr.Remove(zbr);
            this.boardR.PutBall(zbr, location);
            zbr.RenderMover = RenderMoveManager.GenerateHopMover(zbr.Location, Maths.HexVector(location, 2.0f * ZertzRingRenderer.OUTER_RADIUS + ZertzRingRenderer.SPACING, 0.5f * ZertzRingRenderer.THICKNESS), 1.5f, null);
        }
コード例 #2
0
 public override void OnLoad(EventArgs e)
 {
     this.ti.OnLoad(e);
     this.si.CurrentState = 0x00;
     this.si.OnLoad(e);
     this.zcr.OnLoad(e);
     ZertzBallRenderer.GenerateBalls(ZertzBallContainer.Offset(), this.rc, this.zcr, 0x00);
     ZertzRingRenderer.GenerateRings(this.rc, this.boardR, this.game, this.zcr, this.hls, 0x40);
     this.OnResize(e);
     //this.rc.Add(0x100,);
 }
コード例 #3
0
        public void PerformHop(HexLocation fr, HexLocation to)
        {
            ZertzBallRenderer ball = this.boardR.RemoveBall(fr);

            this.boardR.PutBall(ball, to);
            Vector3 la = ball.Location;
            Vector3 lc = Maths.HexVector(to, 2.0f * ZertzRingRenderer.OUTER_RADIUS + ZertzRingRenderer.SPACING, 0.5f * ZertzRingRenderer.THICKNESS);
            Vector3 lb = 0.5f * (la + lc);

            lb.Y            += 0.5f;
            ball.RenderMover = RenderMoveManager.GenerateHopMover(la, lb, lc, 0.5f, null);
        }
コード例 #4
0
 public void SelectedItem(ISelectable sel)
 {
     if (sel == null)
     {
         return;
     }
     try {
         if (sel is ZertzBallRenderer)
         {
             ZertzBallRenderer zbr = (ZertzBallRenderer)sel;
             if (zbr.Container != ZertzBallContainerType.None)
             {
                 this.game.TakeBall(zbr.Type);
             }
         }
         else if (sel is ZertzRingRenderer)
         {
             ZertzRingRenderer zrr = (ZertzRingRenderer)sel;
             this.game.SelectPiece(zrr.HexLocation);
         }
         else if (sel is LinuxFlag)
         {
             if (this.state == SceneActionState.Select)
             {
                 this.state = SceneActionState.Caputure;
             }
             else
             {
                 this.game.EndTurn();
             }
         }
     }
     catch (Exception e) {
         Console.WriteLine(e);
         this.MessageBoard.PostMessage(this, e.Message);
     }
 }