コード例 #1
0
ファイル: WorldLocationMgr.cs プロジェクト: uvbs/Asda2-Server
        public static GossipMenu CreateTeleMenu(List <INamedWorldZoneLocation> locations,
                                                Action <GossipConversation, INamedWorldZoneLocation> callback)
        {
            GossipMenu gossipMenu = new GossipMenu();

            foreach (INamedWorldZoneLocation location in locations)
            {
                INamedWorldZoneLocation loc = location;
                gossipMenu.AddItem((GossipMenuItemBase) new GossipMenuItem(loc.Names.LocalizeWithDefaultLocale(),
                                                                           (GossipActionHandler)(convo => callback(convo, loc))));
            }

            return(gossipMenu);
        }
コード例 #2
0
        public static GossipMenu CreateTeleMenu(List <INamedWorldZoneLocation> locations, Action <GossipConversation, INamedWorldZoneLocation> callback)
        {
            // create gossip of all options
            var menu = new GossipMenu();

            foreach (var location in locations)
            {
                var loc = location;                             // create local reference

                // TODO: Localize names
                menu.AddItem(new GossipMenuItem(loc.Names.LocalizeWithDefaultLocale(), convo =>
                {
                    callback(convo, loc);
                }));
            }
            return(menu);
        }