public void DrawBathRoomStaff(BathRoom bath) { if (bath.Bag == null && bath.SmallBag == null && bath.Things.Count == 0) { return; } else { if (bath.Bag != null) { String html = "<b>" + bath.Bag.Name + "</b><br />"; var ls = bath.Bag.Things.GroupBy(x => new { x.Name, x.id, x.UseCount }).OrderBy(o => o.Key.Name).Select(obj => obj.ToList()).ToList(); html += "<table class=\"tableview\">"; foreach (var stfobj in ls) { String Methods = ""; var stf = stfobj.FirstOrDefault(); if (stf.GetType() == typeof(WashSoap)) { String WashEv = RegisterEvent(() => { if (!GetPlayer().WashMySelf((WashSoap)stf)) { GetPlayer().RemoveStaff(stf, bath.Bag); } data.time.AddTime(15); }, bath.Scene); Methods += "<a href='callback:" + WashEv + @"'>Мыться</a>"; } if (stf.GetType() == typeof(Shaver)) { String ShavePussyFull = RegisterEvent(() => { if (!GetPlayer().ShavePussy((Shaver)stf, 0)) { GetPlayer().RemoveStaff(stf, bath.Bag); } data.time.AddTime(15); }, bath.Scene); String ShavePussyHalf = RegisterEvent(() => { if (!GetPlayer().ShavePussy((Shaver)stf, 1)) { GetPlayer().RemoveStaff(stf, bath.Bag); } data.time.AddTime(15); }, bath.Scene); String ShaveLegs = RegisterEvent(() => { if (!GetPlayer().ShaveLegs((Shaver)stf)) { GetPlayer().RemoveStaff(stf, bath.Bag); } data.time.AddTime(15); }, bath.Scene); String ShaveHands = RegisterEvent(() => { if (!GetPlayer().ShaveHands((Shaver)stf)) { GetPlayer().RemoveStaff(stf, bath.Bag); } data.time.AddTime(15); }, bath.Scene); Methods += "<a href='callback:" + ShavePussyFull + @"'>Брить кису налысо</a> | <a href='callback:" + ShavePussyHalf + @"'>Оставить полоску</a> | <a href='callback:" + ShaveLegs + @"'>Брить ноги</a> | <a href='callback:" + ShaveHands + @"'>Брить подмышки</a> "; } if (String.IsNullOrEmpty(Methods)) { continue; } html += @"<tr> <td>" + stf.Name + ((stf.UseCount > 0) ? " (" + stf.UseCount + " раз)" : "") + @"</td> <td>" + stfobj.Count + @"</td> <td>" + Methods + @"</td> </tr>"; } html += "</table>"; sc.Description += html + "<br/>"; } if (bath.SmallBag != null) { String html = "<b>" + bath.SmallBag.Name + "</b><br />"; var ls = bath.SmallBag.Things.GroupBy(x => new { x.Name, x.id, x.UseCount }).OrderBy(o => o.Key.Name).Select(obj => obj.ToList()).ToList(); html += "<table class=\"tableview\">"; foreach (var stfobj in ls) { String Methods = ""; var stf = stfobj.FirstOrDefault(); if (stf.GetType() == typeof(WashSoap)) { String WashEv = RegisterEvent(() => { if (!GetPlayer().WashMySelf((WashSoap)stf)) { GetPlayer().RemoveStaff(stf, bath.SmallBag); } data.time.AddTime(15); }, bath.Scene); Methods += "<a href='callback:" + WashEv + @"'>Мыться</a> "; } if (stf.GetType() == typeof(Shaver)) { String ShavePussyFull = RegisterEvent(() => { if (!GetPlayer().ShavePussy((Shaver)stf, 0)) { GetPlayer().RemoveStaff(stf, bath.SmallBag); } data.time.AddTime(15); }, bath.Scene); String ShavePussyHalf = RegisterEvent(() => { if (!GetPlayer().ShavePussy((Shaver)stf, 1)) { GetPlayer().RemoveStaff(stf, bath.SmallBag); } data.time.AddTime(15); }, bath.Scene); String ShaveLegs = RegisterEvent(() => { if (!GetPlayer().ShaveLegs((Shaver)stf)) { GetPlayer().RemoveStaff(stf, bath.SmallBag); } data.time.AddTime(15); }, bath.Scene); String ShaveHands = RegisterEvent(() => { if (!GetPlayer().ShaveHands((Shaver)stf)) { GetPlayer().RemoveStaff(stf, bath.SmallBag); } data.time.AddTime(15); }, bath.Scene); Methods += "<a href='callback:" + ShavePussyFull + @"'>Брить кису налысо</a> | <a href='callback:" + ShavePussyHalf + @"'>Оставить полоску</a> | <a href='callback:" + ShaveLegs + @"'>Брить ноги</a> | <a href='callback:" + ShaveHands + @"'>Брить подмышки</a> "; } if (String.IsNullOrEmpty(Methods)) { continue; } html += @"<tr> <td>" + stf.Name + ((stf.UseCount > 0) ? " (" + stf.UseCount + " раз)" : "") + @"</td> <td>" + stfobj.Count + @"</td> <td>" + Methods + @"</td> </tr>"; } html += "</table>"; sc.Description += html + "<br/>"; } if (bath.Things != null) { String html = "<b> Вещи в комнате " + bath.Name + "</b><br />"; var ls = bath.Things.GroupBy(x => new { x.Name, x.id, x.UseCount }).OrderBy(o => o.Key.Name).Select(obj => obj.ToList()).ToList(); html += "<table class=\"tableview\">"; foreach (var stfobj in ls) { String Methods = ""; var stf = stfobj.FirstOrDefault(); if (stf.GetType() == typeof(WashSoap)) { String WashEv = RegisterEvent(() => { if (!GetPlayer().WashMySelf((WashSoap)stf)) { bath.RemoveStaff(stf, 1); } data.time.AddTime(15); }, bath.Scene); Methods += "<a href='callback:" + WashEv + @"'>Мыться</a> "; } if (stf.GetType() == typeof(Shaver)) { String ShavePussyFull = RegisterEvent(() => { if (!GetPlayer().ShavePussy((Shaver)stf, 0)) { bath.RemoveStaff(stf, 1); } data.time.AddTime(15); }, bath.Scene); String ShavePussyHalf = RegisterEvent(() => { if (!GetPlayer().ShavePussy((Shaver)stf, 1)) { bath.RemoveStaff(stf, 1); } data.time.AddTime(15); }, bath.Scene); String ShaveLegs = RegisterEvent(() => { if (!GetPlayer().ShaveLegs((Shaver)stf)) { bath.RemoveStaff(stf, 1); } data.time.AddTime(15); }, bath.Scene); String ShaveHands = RegisterEvent(() => { if (!GetPlayer().ShaveHands((Shaver)stf)) { bath.RemoveStaff(stf, 1); } data.time.AddTime(15); }, bath.Scene); Methods += "<a href='callback:" + ShavePussyFull + @"'>Брить кису налысо</a> | <a href='callback:" + ShavePussyHalf + @"'>Оставить полоску</a> | <a href='callback:" + ShaveLegs + @"'>Брить ноги</a> | <a href='callback:" + ShaveHands + @"'>Брить подмышки</a> "; } if (String.IsNullOrEmpty(Methods)) { continue; } html += @"<tr> <td>" + stf.Name + ((stf.UseCount > 0) ? " (" + stf.UseCount + " раз)" : "") + @"</td> <td>" + stfobj.Count + @"</td> <td>" + Methods + @"</td> </tr>"; } html += "</table>"; sc.Description += html + "<br/>"; } } }
void Start () { bath = BathZone.GetComponent<BathRoom>(); List<string> sequence = new List<string>(); }