Example #1
0
 public SlotMachineState(SlotMachineSettings settings)
 {
     Settings = settings;
     r = new Random();
     Settings.Changed += Settings_Changed;
     WheelRotation = new int[settings.Wheels];
 }
Example #2
0
        /// <summary>
        /// creates a new slot machine
        /// </summary>
        /// <param name="Settings">The Settings to use for the slot machine</param>
        /// <param name="State">The InternalState to use for the slot machine</param>
        public SlotMachine(SlotMachineSettings Settings, SlotMachineState State)
        {
            if (Settings == null)
            {
                Settings = new SlotMachineSettings();

                if (Console.CursorLeft != 0)
                {
                    Console.WriteLine();
                    Settings.Left = Console.CursorLeft;
                    Settings.Top = Console.CursorTop;
                }
            }

            if (State == null)
            {
                State = new SlotMachineState(Settings);
            }

            this.State = State;
            this.Settings = Settings;
        }
Example #3
0
 /// <summary>
 /// Creates a new slot machine with default InternalState
 /// </summary>
 /// <param name="Settings">The Settings to use for the slot machine</param>
 public SlotMachine(SlotMachineSettings Settings)
     : this(Settings, null)
 {
 }