Example #1
0
 private void Update()
 {
     if (resource.State != UserResource.StateType.FIXED)
     {
         return;
     }
     if (IsFixed)
     {
         return;
     }
     if (IsWaiting)
     {
         Finders.ForEach(f => f.UnedgeAll());
         IsWaiting = false;
         return;
     }
     if (TrainIdx < storage.List <Train>().Count)
     {
         RouteTrain();
         return;
     }
     if (RailLineIdx < storage.List <RailLine>().Count)
     {
         Scan();
         return;
     }
     Finders[FinderIdx].Execute();
     FinderIdx++;
     TrainIdx    = 0;
     RailLineIdx = 0;
 }
Example #2
0
    private void Update()
    {
        if (!trans.IsWaiting && !trans.IsFixed)
        {
            return;
        }
        if (resource.State == UserResource.StateType.STARTED)
        {
            return;
        }
        if (IsFixed)
        {
            return;
        }
        if (IsWaiting)
        {
            // 以前の経路探索結果 Dept <=> P を削除
            Finders.ForEach(f =>
            {
                storage.List <DeptTask>().ForEach(dept =>
                {
                    f.Unnode(dept);
                    f.Node(dept);
                    f.Edge(dept.Stay, dept, 0);
                });
            });
            IsWaiting = false;
            return;
        }
        if (!trans.IsWaiting && !trans.IsFixed)
        {
            return;
        }
        if (PlatformIdx < storage.List <Platform>().Count)
        {
            CopyTransport();
            return;
        }

        RouteHuman();
        Finders[FinderIdx].Execute();
        storage.List <Human>().ForEach(h => h.Reroute());
        FinderIdx++;
        PlatformIdx = 0;
    }