예제 #1
0
        public OfferDetailScene(JobOffer offer, PlaceState state, bool isRescheduling = false) : base(offer.Company)
        {
            this.isRescheduling     = isRescheduling;
            this.offer              = offer;
            this.place              = state;
            isOfferDestinationOwned = WorldState.PlaceOwned(this.offer.To);
            distance    = this.offer.GetDistanceInKm();
            travelHours = this.offer.GetTravelTime();

            List <TabControlItemWidget> tabs = new List <TabControlItemWidget>();

            for (int i = 0; i < place.Docks.Count; i++)
            {
                var item = place.Docks[i];
                var tab  = new TabControlItemWidget(this, "Dock " + (i + 1), item);
                tab.OnClick += Tab_OnClick;
                tabs.Add(tab);
                var newSchedule = new ScheduleWidget(this, item.Schedule, offer, item.Unlocked, isRescheduling);
                newSchedule.OnNewShipTimeSelected += NewSchedule_OnNewShipTimeSelected;
                schedules.Add(newSchedule);
            }
            tabcontrol           = new TabControlWidget(this, tabs);
            employeeFinderWidget = new EmployeeFinderWidget(this);
            employeeFinderWidget.OnEmployeeSelected += EmployeeFinderWidget_OnEmployeeSelected;

            checkmarkWidget = new CheckmarkWidget("Stay At Destination");
            checkmarkWidget.OnCheckChanged += CheckmarkWidget_OnCheckChanged;

            buttonAccept          = new DetailButtonWidget(true);
            buttonAccept.Text     = "Accept";
            buttonAccept.OnClick += ButtonAccept_OnClick;
        }
예제 #2
0
        public EmployeeDetailScene(EmployeeState employee, PlaceState state) : base(employee.Name + ", " + employee.Age + ", " + employee.Id)
        {
            this.employee    = employee;
            this.place       = state;
            assignableTrucks = state.Trucks.Where(e => e.Assignee == null || e == employee.AssignedTruck).ToList();

            if (this.employee.AssignedTruck != null)
            {
                for (int i = 0; i < assignableTrucks.Count; i++)
                {
                    var truck = assignableTrucks[i];
                    if (truck == employee.AssignedTruck)
                    {
                        selectedTruckIndex = i;
                        break;
                    }
                }
            }

            List <TabControlItemWidget> tabs = new List <TabControlItemWidget>();

            for (int i = 0; i < place.Docks.Count; i++)
            {
                var item = place.Docks[i];
                var tab  = new TabControlItemWidget(this, "Dock " + (i + 1), item);
                tab.OnClick += Tab_OnClick;
                tabs.Add(tab);
                var newSchedule = new ScheduleWidget(this, item.Schedule, null, item.Unlocked, false, employee);
                schedules.Add(newSchedule);
            }
            tabcontrol = new TabControlWidget(this, tabs);

            buttonAccept          = new DetailButtonWidget(true);
            buttonAccept.Text     = "Accept";
            buttonAccept.OnClick += ButtonAccept_OnClick;

            arrowButtonLeft           = new ArrowButtonWidget(PointingTo.Left);
            arrowButtonLeft.OnClick  += ArrowButtonLeft_OnClick;
            arrowButtonRight          = new ArrowButtonWidget(PointingTo.Right);
            arrowButtonRight.OnClick += ArrowButtonRight_OnClick;
            if (employee.AssignedTruck == null)
            {
                truckBanner = new BannerWidget("No Assigned Truck");
            }
            else
            {
                truckBanner = new TruckBannerWidget(employee.AssignedTruck);
            }
            truckBanner.Disabled = true;
        }
예제 #3
0
        public ScheduleDetailScene(PlaceState state) : base("Schedule for " + state.Place.Name)
        {
            this.place = state;
            List <TabControlItemWidget> tabs = new List <TabControlItemWidget>();

            for (int i = 0; i < place.Docks.Count; i++)
            {
                var item = place.Docks[i];
                var tab  = new TabControlItemWidget(this, "Dock " + (i + 1), item);
                tab.OnClick += Tab_OnClick;
                tabs.Add(tab);
                var schedule = new ScheduleWidget(this, item.Schedule, null, item.Unlocked);
                schedule.OnScheduledOfferSelected += Schedule_OnScheduledOfferSelected;
                schedules.Add(schedule);
            }
            tabcontrol          = new TabControlWidget(this, tabs);
            buttonEdit          = new DetailButtonWidget(true);
            buttonEdit.OnClick += ButtonEdit_OnClick;
        }