デバッグログ削除

This commit is contained in:
kimura 2021-10-29 10:11:31 +09:00
parent e32a8fffac
commit 822e194979
1 changed files with 16 additions and 6 deletions

View File

@ -99,16 +99,17 @@ public class Market : SingletonMonoBehaviour<Market>
// 購入リクエスト // 購入リクエスト
var maxOrder = orderPosisionObject.transform.childCount; var maxOrder = orderPosisionObject.transform.childCount;
orderSubject.Do(_ => { Debug.Log($"aa orderSubject");}) Observable.Merge(
.Merge(waitCustomerList.ObserveAdd().AsUnitObservable().Do(_ => { Debug.Log($"aa waitCustomerListAdd");})) orderSubject /*.Do(_ => { Debug.Log($"aa orderSubject");})*/,
.Merge(shopState.Where(x => x == ShopState.Open).AsUnitObservable().Do(_ => { Debug.Log($"aa shopStateOpen");})) waitCustomerList.ObserveAdd().AsUnitObservable() /*.Do(_ => { Debug.Log($"aa waitCustomerListAdd");})*/,
shopState.Where(x => x == ShopState.Open).AsUnitObservable() /*.Do(_ => { Debug.Log($"aa shopStateOpen");})*/
)
.BatchFrame() .BatchFrame()
.Where(_ => waitCustomerList.Count > 0) .Where(_ => waitCustomerList.Count > 0)
.SelectMany(_ => waitCustomerList.ToList().GetRange(0, Mathf.Min(maxOrder, waitCustomerList.Count))) .SelectMany(_ => waitCustomerList.ToList().GetRange(0, Mathf.Min(maxOrder, waitCustomerList.Count)))
.Subscribe(customer => .Subscribe(customer =>
{ {
var count = customerList.Count(x => x.State.Value == CustomerState.Order); var count = customerList.Count(x => x.State.Value == CustomerState.Order);
Debug.Log($"aa order:{count} Request {Time.time} {customer.GetHashCode()}");
if (count >= maxOrder) if (count >= maxOrder)
{ {
// shopState.Value = ShopState.Busy; // shopState.Value = ShopState.Busy;
@ -171,8 +172,17 @@ public class Market : SingletonMonoBehaviour<Market>
} }
catch (Exception e) catch (Exception e)
{ {
Debug.LogError($"d:{displayFlavors.Count}, {string.Join("", tmpOrders)}"); Debug.LogError($"d:{displayFlavors.Count}, {string.Join("", tmpOrders)}" +
throw; $"\nshuffled:{shuffledOrder.Count}, maxNum:{shuffledOrder.Max()}");
/*
*
* orderを引いたのでそのまま処理せず逃がす
*/
controller.CallWaitForSeconds(1.5f, () =>
{
controller.ChangeCustomerState(CustomerState.Leave);
});
dontBuyCustomerList.Add(controller);
} }
} }
foreach (var customerController in dontBuyCustomerList) foreach (var customerController in dontBuyCustomerList)