Beispiel #1
0
    private static string GetGirlByStar(int star, Tables.GuestInfoRecord guestInfo)
    {
        Debug.Log(guestInfo.Id + "," + star);
        if (star <= 3)
        {
            return(GetGirlByStar(star, false, guestInfo));
        }

        if (star == 4)
        {
            return(GetGirlByStar(3, true, guestInfo));
        }

        if (star == 5)
        {
            return(GetGirlByStar(4, false, guestInfo));
        }

        if (star == 6)
        {
            return(GetGirlByStar(4, true, guestInfo));
        }

        if (star == 7)
        {
            return(GetGirlByStar(5, false, guestInfo));
        }

        if (star == 8)
        {
            return(GetGirlByStar(5, true, guestInfo));
        }

        return("");
    }
Beispiel #2
0
    private static string GetGirlByStar(int star, bool isWithEquip, Tables.GuestInfoRecord guestInfo)
    {
        List <Tables.GirlInfoRecord> girls = new List <Tables.GirlInfoRecord>();

        foreach (var girlInfo in Tables.TableReader.GirlInfo.Records)
        {
            if (girlInfo.Value.Star != star)
            {
                continue;
            }

            if (guestInfo.Attr1AAttract > 0 && girlInfo.Value.Attr1A == 0)
            {
                continue;
            }
            if (guestInfo.Attr1BAttract > 0 && girlInfo.Value.Attr1B == 0)
            {
                continue;
            }
            if (guestInfo.Attr2AAttract > 0 && girlInfo.Value.Attr2A == 0)
            {
                continue;
            }
            if (guestInfo.Attr2BAttract > 0 && girlInfo.Value.Attr2B == 0)
            {
                continue;
            }
            if (guestInfo.Attr3AAttract > 0 && girlInfo.Value.Attr3A == 0)
            {
                continue;
            }
            if (guestInfo.Attr3BAttract > 0 && girlInfo.Value.Attr3B == 0)
            {
                continue;
            }

            girls.Add(girlInfo.Value);
        }

        int idx = Random.Range(0, girls.Count);

        var girl = girls[idx];

        int equip = isWithEquip ? 1 : 0;

        string girlStr = girl.Id.ToString() + "\t" + equip.ToString() + "\t" + star + "\t" + guestInfo.Id;

        return(girlStr);
    }
Beispiel #3
0
        private void ParserTableStr(string content)
        {
            StringReader rdr = new StringReader(content);

            using (var reader = new CsvReader(rdr))
            {
                HeaderRecord header = reader.ReadHeaderRecord();
                while (reader.HasMoreRecords)
                {
                    DataRecord data = reader.ReadDataRecord();
                    if (data[0].StartsWith("#"))
                    {
                        continue;
                    }

                    GuestInfoRecord record = new GuestInfoRecord(data);
                    Records.Add(record.Id, record);
                }
            }
        }