示例#1
0
 public ZertzContainerRenderer(ZertzBallContainerType type, float row, float offset, float ballHeight)
 {
     this.type = type;
     this.row = row;
     this.offset = offset;
     this.ballHeight = ballHeight;
 }
示例#2
0
 public ZertzContainerRenderer(ZertzBallContainerType type, float row, float offset, float ballHeight)
 {
     this.type       = type;
     this.row        = row;
     this.offset     = offset;
     this.ballHeight = ballHeight;
 }
示例#3
0
 private void perform_CaptureBall(HexLocation loc, ZertzBallContainerType zbct)
 {
     lock(this.handlers) {
         foreach(IZertzActionHandler izah in this.handlers) {
             izah.CaptureBall(loc,zbct);
         }
     }
 }
示例#4
0
 private void perform_PutBall(ZertzBallContainerType containertype, ZertzBallType type, HexLocation location)
 {
     lock (this.handlers) {
         foreach (IZertzActionHandler izah in this.handlers)
         {
             izah.PutBall(containertype, type, location);
         }
     }
 }
示例#5
0
 private void perform_CaptureBall(HexLocation loc, ZertzBallContainerType zbct)
 {
     lock (this.handlers) {
         foreach (IZertzActionHandler izah in this.handlers)
         {
             izah.CaptureBall(loc, zbct);
         }
     }
 }
示例#6
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);
        }
示例#7
0
        public ZertzContainerRenderer this [ZertzBallContainerType type] {
            get {
                switch (type)
                {
                case ZertzBallContainerType.Common:
                    return(this.zcrc);

                case ZertzBallContainerType.Player1:
                    return(this.zcrpa);

                case ZertzBallContainerType.Player2:
                    return(this.zcrpb);

                default:
                    return(null);
                }
            }
        }
示例#8
0
            public override ZertzMoveState TakeBall(ZertzBallType ball)
            {
                //GUARD
                if (this.Board.CanHop())
                {
                    throw new InvalidZertzActionException("Unable to do this action: capture move possible!");
                }
                if (!this.Game.PlayerPoolsContains(ball))
                {
                    throw new InvalidZertzActionException("Unable to do this action: player doesn't have this type of ball available!");
                }
                if (!this.Board.HasVacant())
                {
                    throw new InvalidZertzActionException("Unable to do this action: no vacant piece available!");
                }
                ZertzBallContainerType source = this.Game.SourceType;

                //ACTIONS
                this.Game.DecreasePlayerPool(ball);
                //EVENTS
                this.Creator.perform_ChangeState(0x01);
                //NEXT_STATE
                return(new PlacRem1ZertzMoveState(this.Creator, ball, source));
            }
示例#9
0
 public PlacRem1ZertzMoveState(ZertzMoveCreator creator, ZertzBallType ball, ZertzBallContainerType source)
     : base(creator)
 {
     this.ball = ball;
     this.source = source;
 }
示例#10
0
 private void perform_PutBall(ZertzBallContainerType containertype, ZertzBallType type, HexLocation location)
 {
     lock(this.handlers) {
         foreach(IZertzActionHandler izah in this.handlers) {
             izah.PutBall(containertype,type,location);
         }
     }
 }
示例#11
0
 public ZertzContainerRenderer this[ZertzBallContainerType type]
 {
     get {
         switch(type) {
             case ZertzBallContainerType.Common:
                 return this.zcrc;
             case ZertzBallContainerType.Player1:
                 return this.zcrpa;
             case ZertzBallContainerType.Player2:
                 return this.zcrpb;
             default :
                 return null;
         }
     }
 }
示例#12
0
 public PlacRem1ZertzMoveState(ZertzMoveCreator creator, ZertzBallType ball, ZertzBallContainerType source) : base(creator)
 {
     this.ball   = ball;
     this.source = source;
 }
示例#13
0
 public void CaptureBall(HexLocation location, ZertzBallContainerType type)
 {
 }
示例#14
0
 public void CaptureBall(HexLocation location, ZertzBallContainerType type)
 {
 }
示例#15
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);
 }