Beispiel #1
0
        /// <summary> Initializes internal array with <c>capacity</c> using default values </summary>
        public RingBuffer(int capacity)
        {
            this.index = new RingIndex {
                capacity = capacity,
            };
            this.nItems = 0;

            this.items = new List <T>(this.index.capacity);
            for (int i = 0; i < capacity; i++)
            {
                this.items.Add(default(T));
            }
        }
Beispiel #2
0
        public int CompareTo(PolygonBoundaryLocation other)
        {
            if (other == null)
            {
                return(1);
            }
            int compareResult;

            return((compareResult = RingIndex.CompareTo(other.RingIndex)) == 0
                ? (
                       (compareResult = SegmentIndex.CompareTo(other.SegmentIndex)) == 0
                    ? SegmentRatio.CompareTo(other.SegmentRatio)
                    : compareResult
                       )
                : compareResult);
        }
Beispiel #3
0
        public Window(Window other)
            : base(other)
        {
            SelectedButtonIndex = new RingIndex();
            SelectedButtonIndex.UpperBound = other.SelectedButtonIndex.UpperBound;
            SelectedButtonIndex.Value = other.SelectedButtonIndex.Value;

            Buttons = new List<Button>();
            foreach (var button in other.Buttons)
            {
                // Add a copy
                Buttons.Add(new Button(button));
            }

            BackgroundTexture = other.BackgroundTexture;
            BackgroundTextureName = other.BackgroundTextureName;
        }
Beispiel #4
0
 public Window(Game game)
     : base(game)
 {
     SelectedButtonIndex = new RingIndex();
     Buttons = new List<Button>();
 }