SharpMod.PlayerMenuExtender.SelectMenu C# (CSharp) Method

SelectMenu() public static method

public static SelectMenu ( this player, int index ) : void
player this
index int
return void
        public static void SelectMenu(this Player player, int index)
        {
            #if DEBUG
            Console.WriteLine("SelectMenu({0}, {1})", player.Name, index);
            #endif
            MenuTime mt;
            if (dict.TryGetValue(player, out mt)) {
                dict.Remove(player);

                if (DateTime.Now <= mt.start.Add(mt.timeSpan)) {
                    mt.menu.DoSelect(player, index);
                } else {
                    // TODO: random menuselect, make a log entry for abusive behaviour?
                    #if DEBUG
                    Console.WriteLine("SelectMenu({0}, {1})- bad time", player.Name, index);
                    #endif
                }
            }
        }