示例#1
0
            public string GetName(string sex)
            {
                string name = string.Format("{0} {1}", (object)NamesPool.Choose(this.ListA), (object)NamesPool.Choose(this.ListB));

                NamesPool.AppendDuplicate(ref name, ref this.UsedNames);
                return(name);
            }
示例#2
0
            public string GetName(string sex)
            {
                string name = NamesPool.Choose(this.ListA);

                NamesPool.AppendDuplicate(ref name, ref this.UsedNames);
                return(name);
            }
示例#3
0
            public string GetName(
                GameSession game,
                int playerid,
                ShipClass shipclass,
                IEnumerable <string> checknames = null)
            {
                string name = "";

                foreach (List <KeyValuePair <string, string> > list in this.Lists)
                {
                    if (list.Any <KeyValuePair <string, string> >((Func <KeyValuePair <string, string>, bool>)(x =>
                    {
                        if (!(x.Key == ""))
                        {
                            return(x.Key.ToLower().Contains(shipclass.ToString().ToLower()));
                        }
                        return(true);
                    })))
                    {
                        name += string.Format("{0}", (object)NamesPool.Choose(list.Where <KeyValuePair <string, string> >((Func <KeyValuePair <string, string>, bool>)(x =>
                        {
                            if (!(x.Key == ""))
                            {
                                return(x.Key.ToLower().Contains(shipclass.ToString().ToLower()));
                            }
                            return(true);
                        })).Select <KeyValuePair <string, string>, string>((Func <KeyValuePair <string, string>, string>)(x => x.Value)).ToList <string>()));
                    }
                }
                List <string> usedNames = new List <string>();

                usedNames.AddRange(game.GameDatabase.GetShipInfos(true).Where <ShipInfo>((Func <ShipInfo, bool>)(x => x.DesignInfo.PlayerID == playerid)).Select <ShipInfo, string>((Func <ShipInfo, string>)(x => x.ShipName)));
                foreach (InvoiceInfo invoiceInfo in game.GameDatabase.GetInvoiceInfosForPlayer(playerid))
                {
                    foreach (BuildOrderInfo buildOrderInfo in game.GameDatabase.GetBuildOrdersForInvoiceInstance(invoiceInfo.ID))
                    {
                        usedNames.Add(buildOrderInfo.ShipName);
                    }
                }
                if (checknames != null)
                {
                    usedNames.AddRange(checknames);
                }
                NamesPool.AppendDuplicate(ref name, ref usedNames);
                return(name);
            }
示例#4
0
 public string GetSalvageProjectName(string projtype)
 {
     return(App.Localize(NamesPool.Choose(NamesPool.SalvageProjectNames[projtype])));
 }
示例#5
0
 public string GetFleetName(string faction)
 {
     return(NamesPool.Choose(NamesPool.FleetNames[faction]));
 }