示例#1
0
 public DayModel(bool isRaideable)
 {
     this.dayID              = 0;
     this.numDay             = 1;
     this.numMonth           = 1;
     this.numYear            = 1995;
     this.dayOfWeek          = DayOfWeek.Monday;
     this.isRaideable        = isRaideable;
     this.assistanceSelected = AssistanceType.None;
 }
示例#2
0
 public DayModel(DayModel newDayModel)
 {
     this.dayID              = 0;
     this.day                = newDayModel.day;
     this.numDay             = newDayModel.numDay;
     this.numMonth           = newDayModel.numMonth;
     this.numYear            = newDayModel.numYear;
     this.dayOfWeek          = newDayModel.dayOfWeek;
     this.isRaideable        = newDayModel.isRaideable;
     this.assistanceSelected = newDayModel.assistanceSelected;
 }
示例#3
0
 public DayModel(Day day, int numDay = 1, int numMonth = 1, int numYear = 1995, DayOfWeek dayOfWeek = DayOfWeek.Monday, bool isRaideable = true, AssistanceType assistanceSelected = AssistanceType.Assist)
 {
     this.dayID              = 0;
     this.day                = day;
     this.numDay             = numDay;
     this.numMonth           = numMonth;
     this.numYear            = numYear;
     this.dayOfWeek          = dayOfWeek;
     this.isRaideable        = isRaideable;
     this.assistanceSelected = assistanceSelected;
 }
示例#4
0
 public void OnAssistanceTypeClick(AssistanceType assistanceType, int lateTime = 0)
 {
     CloseDayInfo();
     //Set Day assistance (To change style)
     selectedDay.dayModel.lateTime           = lateTime;
     selectedDay.dayModel.AssistanceSelected = assistanceType;
     //Update current Raider Calendar
     MainController.s_Instance.currentRaider.month[MainController.s_Instance.currentRaider.month.FindIndex(DayModel => DayModel == selectedDay.dayModel)] = selectedDay.dayModel;
     //Update Rotations
     //MainController.s_Instance.rosterController.GenerateDayRotation(selectedDay);
     //UpdateDB is done in the properties, as it can be affected not only by assistance
 }
示例#5
0
 private void OnAssistanceTypeClick(AssistanceType assistanceType)
 {
     //If Late, check how late
     if (assistanceType == AssistanceType.Late)
     {
         UIController.s_Instance.OnAssistanceTypeClick(assistanceType, GetHowManyLateMinutes());
     }
     else
     {
         UIController.s_Instance.OnAssistanceTypeClick(assistanceType);
     }
 }
示例#6
0
 public AIData(string Tag = null)
     : base(Tag)
 {
     Aggression          = new AggressionType();
     Confidence          = new ConfidenceType();
     EnergyLevel         = new Byte();
     Responsibility      = new Byte();
     Mood                = new MoodType();
     Unused              = new byte[3];
     Services            = new ServicesFlag();
     Teaches             = new Skills();
     MaxTrainingLevel    = new Byte();
     Assistance          = new AssistanceType();
     AggroRadiusBehavior = new AggroRadiusBehaviorFlags();
     AggroRadius         = new Int32();
 }
示例#7
0
    //Return the raiders list depending on the assistance we want
    private List <Raider> GetListFromAssistance(AssistanceType assistanceType)
    {
        switch (assistanceType)
        {
        case AssistanceType.Assist:
            return(acceptedRaiders);

        case AssistanceType.Decline:
            return(declinedRaiders);

        case AssistanceType.Late:
            return(lateRaiders);

        case AssistanceType.None:
            return(null);
        }
        return(null);
    }
示例#8
0
    private void AddRaiderToListDB(Raider raiderToRemove, AssistanceType assistanceType)
    {
        switch (assistanceType)
        {
        case AssistanceType.Assist:
            MainController.s_Instance.dbController.PostAddRaiderOnAcceptedRaiders(null, raiderToRemove.raiderID, this.dayModel.dayID);
            break;

        case AssistanceType.Decline:
            MainController.s_Instance.dbController.PostAddRaiderOnDeclinedRaiders(null, raiderToRemove.raiderID, this.dayModel.dayID);
            break;

        case AssistanceType.Late:
            MainController.s_Instance.dbController.PostAddRaiderOnLateRaiders(null, raiderToRemove.raiderID, this.dayModel.dayID);
            break;

        case AssistanceType.None:
            break;
        }
    }
示例#9
0
    //REMOVE/ADD ABOVE LISTS
    private void RemoveRaiderFromListDB(Raider raiderToRemove, AssistanceType assistanceType)
    {
        switch (assistanceType)
        {
        case AssistanceType.Assist:
            MainController.s_Instance.dbController.PostRemoveRaiderOnAcceptedRaiders((result) => { print(result); }, raiderToRemove.raiderID, this.dayModel.dayID);
            break;

        case AssistanceType.Decline:
            MainController.s_Instance.dbController.PostRemoveRaiderOnDeclinedRaiders((result) => { print(result); }, raiderToRemove.raiderID, this.dayModel.dayID);
            break;

        case AssistanceType.Late:
            MainController.s_Instance.dbController.PostRemoveRaiderOnLateRaiders((result) => { print(result); }, raiderToRemove.raiderID, this.dayModel.dayID);
            break;

        case AssistanceType.None:
            break;
        }
    }
示例#10
0
    public void UpdateDayAssistanceRaidersLists()
    {
        //Search in which list the current player belongs
        AssistanceType auxAssistanceType = SearchBelongingRaiderListType();

        //If it's the same list as previous, do nothing
        if ((auxAssistanceType != dayModel.AssistanceSelected) && (auxAssistanceType != AssistanceType.None))
        {
            //If not, remove it from that list
            List <Raider> list      = GetListFromAssistance(auxAssistanceType);
            Raider        auxRaider = MainController.s_Instance.currentRaider;

            //Remove it locally
            list.Remove(GetRaiderFromList(list, auxRaider));    //Needs to be done like that, cause List.Remove needs THE item, not the copy
            //Remove it from DB
            RemoveRaiderFromListDB(auxRaider, auxAssistanceType);

            //Add it to the selected assitance type list
            GetListFromAssistance(dayModel.AssistanceSelected).Add(MainController.s_Instance.currentRaider);
            //Add it to DB
            AddRaiderToListDB(auxRaider, dayModel.AssistanceSelected);
        }
    }
示例#11
0
 public AIData(AggressionType Aggression, ConfidenceType Confidence, Byte EnergyLevel, Byte Responsibility, MoodType Mood, Byte[] Unused, ServicesFlag Services, Skills Teaches, Byte MaxTrainingLevel, AssistanceType Assistance, AggroRadiusBehaviorFlags AggroRadiusBehavior, Int32 AggroRadius)
 {
     this.Aggression          = Aggression;
     this.Confidence          = Confidence;
     this.EnergyLevel         = EnergyLevel;
     this.Responsibility      = Responsibility;
     this.Mood                = Mood;
     this.Unused              = Unused;
     this.Services            = Services;
     this.Teaches             = Teaches;
     this.MaxTrainingLevel    = MaxTrainingLevel;
     this.Assistance          = Assistance;
     this.AggroRadiusBehavior = AggroRadiusBehavior;
     this.AggroRadius         = AggroRadius;
 }