예제 #1
0
        public void SetControlled(HexPoint point, int id, bool doOverride = false, int neighborhood = 0)
        {
            this[point].ControlledBy = id;

            if (neighborhood > 0)
            {
                List<HexPoint> pts = point.GetNeighborhood(neighborhood);

                foreach (HexPoint pt in pts)
                {
                    if (IsValid(pt))
                    {
                        if (!doOverride)
                        {
                            if (this[pt].ControlledBy == -1)
                                this[pt].ControlledBy = id;
                        }
                        else
                            this[pt].ControlledBy = id;
                    }

                }
            }
        }