示例#1
0
    // Update is called once per frame
    void Update()
    {
        switch (m_employeeState)
        {
        case EmployeeState.FALL_OFF:
            if (transform.position.y <= -0.4f)
            {
                m_employeeState = EmployeeState.MOVE;
            }
            else
            {
                Gravity();
            }
            break;

        case EmployeeState.MOVE:
            TransMove();
            if ((transform.position - disappearPosition).sqrMagnitude < 0.5f)
            {
                gameObject.SetActive(false);     //隐掉 回收
            }
            break;

        default: break;
        }
        if (_employeeview && _employeeview.employeesussce)    //处理雇佣成功后模型的隐藏
        {
            gameObject.SetActive(false);
        }
    }
示例#2
0
        public ScheduleWidget(BaseScene scene, PlaceSchedule schedule, JobOffer offerToPlan, bool enabled = true, bool isRescheduling = false, EmployeeState employeeToHighlight = null) : base()
        {
            this.employeeToHighlight = employeeToHighlight;
            this.isRescheduling      = isRescheduling;
            this.scene       = scene;
            this.schedule    = schedule;
            this.offerToPlan = offerToPlan;
            this.enabled     = enabled;
            bg              = ContentLoader.GetTexture("white");
            padlock         = ContentLoader.GetTexture("padlock");
            error           = ContentLoader.GetTexture("error");
            edit            = ContentLoader.GetTexture("edit");
            newScheduledJob = offerToPlan != null ? new ScheduledJob(offerToPlan) : null;

            if (isRescheduling)
            {
                foreach (var job in schedule.Jobs)
                {
                    if (job.Job.Id != offerToPlan.Id)
                    {
                        continue;
                    }
                    foreach (var time in job.ShipTimes)
                    {
                        lastModifiedShipDay = time.Key;
                        newScheduledJob.ShipTimes.Add(time.Key, new ShipTimeAssignment(time.Value.Time, time.Value.AssignedEmployee, time.Value.StayAtLocation));
                    }
                }
            }
        }
示例#3
0
 public void AssignEmployeeToNewTimeslot(EmployeeState employee)
 {
     if (newScheduledJob.ShipTimes.ContainsKey(lastModifiedShipDay))
     {
         newScheduledJob.ShipTimes[lastModifiedShipDay].AssignedEmployee = employee;
     }
 }
 public Employee(Guid id, string title, DateTime createdAt, EmployeeState state, Guid identityId)
 {
     Id        = id;
     Title     = title ?? throw new ArgumentNullException(nameof(title));
     State     = state;
     CreatedAt = createdAt;
     User      = new User(identityId);
 }
        public EmployeeBannerWidget(BaseScene scene, EmployeeState employee) : base()
        {
            font       = scene.GetRDFont("main_font_15");
            this.scene = scene;
            Employee   = employee;

            portrait = ContentLoader.GetTexture("portrait");
        }
 public EmployeeDocument(Guid id, string title, DateTime createdAt, EmployeeState state, Guid userId)
 {
     Id        = id;
     Title     = title;
     CreatedAt = createdAt;
     State     = state;
     UserId    = userId;
 }
示例#7
0
 public Employee()
 {
     Name     = "Undefined Employee";
     Id       = Guid.NewGuid();
     Salary   = 1000.0m;
     Birthday = new DateTime(1000, 1, 1);
     State    = EmployeeState.Employed;
 }
示例#8
0
        //std. Konstruktor //es un metodo en una clase donde no se inicializa. tiene que se exactamente al de la clase  //cada uno tiene una tareass
        //public Employee()
        //{
        //    Name = "No Name";
        //    Salary = 1000.0m;
        //    Birthday = new DateTime(1998, 11, 1);

        //    Id = Guid.NewGuid();
        //    State = EmployeeState.Employed;
        //}

        //user specific constructor

        public Employee(string name, DateTime birthday, decimal salary)
        {
            Id    = Guid.NewGuid();
            State = EmployeeState.Employed;

            Name     = name;
            Birthday = birthday;
            Salary   = salary;
        }
示例#9
0
        public void SeparationRequest()
        {
            employeeState.SeparationRequest();

            if (employeeState is ActiveEmployeeState)
            {
                employeeState = new InActiveEmployeeState();
                Console.WriteLine("Employee state has been moved to : "
                                  + employeeState.GetType().Name);
            }
        }
 public void SetStressLevel(float stressLevel, EmployeeState employeeState, BreakLocation assignedBreakLocation)
 {
     if (employeeState == EmployeeState.Break && assignedBreakLocation?.LocationName == "Toilet")
     {
         renderer.sprite = silly;
     }
     else
     {
         var sprite = GetSprite(stressLevel);
         renderer.sprite = sprite;
     }
 }
示例#11
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;
        }
示例#12
0
 internal ContextState Create(EmployeeState model)
 {
     try
     {
         _com.CommandText = @"INSERT INTO EmployeeStates
               (Name, Description)
                     VALUES     ('" + model.Name + "', '" + model.Description + "')";
         _db.Open();
         _com.ExecuteNonQuery();
         _db.Close();
         return(ReturnedContext(true));
     }
     catch (HttpException ex)
     {
         return(ReturnedContext(false, ex));
     }
 }
        public async Task <EmployeeStateModel> AddAsync(EmployeeStateModel model)
        {
            var entity = new EmployeeState
            {
                PositionId    = model.PositionId,
                JobFunctionId = model.JobFunctionId,
                EmployeeId    = model.EmployeeId,
                ShiftId       = model.ShiftId,
                LevelId       = model.LevelId,
                BusStationId  = model.BusStationId,
                JoinDate      = model.JoinDate,
                ChangedDate   = model.ChangedDate
            };

            entity = await _repository.AddAsync(entity);

            return(_mapper.Map <EmployeeState, EmployeeStateModel>(entity));
        }
示例#14
0
 void Update()
 {
     if (curState == EmployeeState.OnCall)
     {
         callTimer += Time.deltaTime;
     }
     if (curState == EmployeeState.OnCall && callTimer >= 4f)
     {
         if (employeeType.ToString() == assignedCaller.prefferedEmployeeType.ToString())
         {
             CallManager.instance.AddScore(3);
         }
         else
         {
             CallManager.instance.AddScore(1);
         }
         curState  = EmployeeState.Idle;
         sp.color  = Color.white;
         callTimer = 0f;
     }
 }
示例#15
0
 void Start()
 {
     sp        = GetComponent <SpriteRenderer>();
     curState  = EmployeeState.Idle;
     callTimer = 0;
 }
示例#16
0
 public ActiveJob(ScheduledJob job, ShipTimeAssignment assignment, DateTime shipTime, EmployeeState employee)
 {
     this.UsedTruck  = assignment.AssignedEmployee.AssignedTruck;
     this.Job        = job;
     this.Employee   = employee;
     this.ShipDate   = shipTime;
     this.Assignment = assignment;
     this.EndDate    = ShipDate.AddHours(job.Job.GetTravelTime());
 }
示例#17
0
 void OnEnable()
 {
     m_employeeState = EmployeeState.FALL_OFF;
 }
示例#18
0
 private void SetState(EmployeeState state)
 {
     this.state = state;
 }
示例#19
0
 public EmployeePortal()
 {
     employeeState = new ActiveEmployeeState();
 }
示例#20
0
 public Employee(EmployeeType type, EmployeeState state)
 {
     Type  = type;
     State = state;
     ID    = Interlocked.Increment(ref nextId);
 }
示例#21
0
 public Employee(EmployeeState state) : this(EmployeeType.OPERATOR, state)
 {
 }
示例#22
0
 internal void SetSelectedEmployee(EmployeeState assignee)
 {
     this.selectedEmployee = assignee;
     this.text             = assignee == null ? "" : assignee.Id;
 }
示例#23
0
 public void takeCall(Caller caller)
 {
     assignedCaller = caller;
     sp.color       = Color.green;
     curState       = EmployeeState.OnCall;
 }
示例#24
0
 public EmployeeTests()
 {
     state = new EmployeeState();
     sut   = new Employee(state);
 }
 void Start()
 {
     employeeAnimation = this.GetComponent <Animation>();
     employeeState     = EmployeeState.Idle;
 }