デバッグログ削除

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