Example #1
0
 protected virtual void OnStoneChanged(StoneChangedEventArgs e)
 {
     if (this.StoneChanged != null)
     {
         this.StoneChanged(this, e);
     }
 }
Example #2
0
        public bool RemoveStone(int x, int y)
        {
            Space remSpace = this._spaces.GetSpace(x, y);

            if (remSpace.SpaceColor != Space.Color.None)
            {
                remSpace.SpaceColor = Space.Color.None;
                this.removeFromGroup(remSpace);

                StoneChangedEventArgs e = new StoneChangedEventArgs();
                e.Color = remSpace.SpaceColor;
                e.X     = remSpace.X;
                e.Y     = remSpace.Y;
                this.OnStoneChanged(e);

                return(true);
            }
            return(false);
        }
Example #3
0
        public Space AddStone(int x, int y, Space.Color spaceColor)
        {
            Space addSpace = this._spaces.GetSpace(x, y);

            if (addSpace.SpaceColor == Space.Color.None)
            {
                addSpace.SpaceColor = spaceColor;
                this.addToGroup(addSpace);

                StoneChangedEventArgs e = new StoneChangedEventArgs();
                e.Color = addSpace.SpaceColor;
                e.X     = addSpace.X;
                e.Y     = addSpace.Y;
                this.OnStoneChanged(e);

                return(addSpace);
            }
            return(null);
        }