123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311 |
- using System;
- using MaidStatus;
- using TextureBank;
- using UnityEngine;
- namespace Schedule
- {
- public class SlotBase
- {
- public Maid maid
- {
- get
- {
- if (GameMain.Instance.CharacterMgr.status.GetScheduleSlot(this.slotId) != this._maid)
- {
- this.Update();
- }
- return this._maid;
- }
- set
- {
- if (this._maid != value)
- {
- if (value == null)
- {
- GameMain.Instance.CharacterMgr.status.scheduleSlot[this.slotId].maid_guid = string.Empty;
- }
- else
- {
- GameMain.Instance.CharacterMgr.status.scheduleSlot[this.slotId].maid_guid = value.status.guid;
- }
- this._maid = value;
- this.Update();
- }
- }
- }
- public int slotId
- {
- get
- {
- return this._slotId;
- }
- }
- public int noonWorkId
- {
- get
- {
- return this.maid.status.noonWorkId;
- }
- set
- {
- this.maid.status.noonWorkId = value;
- }
- }
- public int nightWorkId
- {
- get
- {
- return this.maid.status.nightWorkId;
- }
- set
- {
- this.maid.status.nightWorkId = value;
- }
- }
- public bool noonCommuFlag
- {
- get
- {
- return this.maid.status.noonCommu;
- }
- set
- {
- this.maid.status.noonCommu = value;
- }
- }
- public int popular_rank
- {
- get
- {
- return this.maid.status.popularRank;
- }
- }
- public bool nightCommuFlag
- {
- get
- {
- return this.maid.status.nightCommu;
- }
- set
- {
- this.maid.status.nightCommu = value;
- }
- }
- public Texture2D popular_rank_icon
- {
- get
- {
- return this._popular_rank_icon;
- }
- }
- public Texture2D icon
- {
- get
- {
- return this.maid.GetThumIcon();
- }
- }
- public bool leader
- {
- get
- {
- return this.maid.status.leader;
- }
- }
- public string last_name
- {
- get
- {
- return this.maid.status.charaName.name1;
- }
- }
- public string first_name
- {
- get
- {
- return this.maid.status.charaName.name2;
- }
- }
- public Contract contract_type
- {
- get
- {
- return this.maid.status.contract;
- }
- }
- public string contract_type_name
- {
- get
- {
- string result = string.Empty;
- if (this.maid.status.heroineType == HeroineType.Sub)
- {
- result = this.maid.status.subCharaStatus.contractText;
- }
- else
- {
- result = EnumConvert.GetString(this.maid.status.contract);
- }
- return result;
- }
- }
- public string contract_type_name_term
- {
- get
- {
- string result = string.Empty;
- if (this.maid.status.heroineType == HeroineType.Sub)
- {
- result = this.maid.status.subCharaStatus.contractTextTerm;
- }
- else
- {
- result = EnumConvert.GetTerm(this.maid.status.contract);
- }
- return result;
- }
- }
- public string personal_name
- {
- get
- {
- if (this.maid.status.heroineType == HeroineType.Sub && this.maid.status.subCharaStatus != null)
- {
- return this.maid.status.subCharaStatus.personalText;
- }
- return this.maid.status.personal.drawName;
- }
- }
- public string personal_name_term
- {
- get
- {
- if (this.maid.status.heroineType == HeroineType.Sub && this.maid.status.subCharaStatus != null)
- {
- return this.maid.status.subCharaStatus.personalTextTerm;
- }
- return this.maid.status.personal.termName;
- }
- }
- public Texture2D noon_icon
- {
- get
- {
- if (this.noon_icon_name == null)
- {
- return null;
- }
- return this.textureBank.GetTexture(this.noon_icon_name);
- }
- }
- public string noon_icon_name
- {
- get
- {
- if (!ScheduleCSVData.AllData.ContainsKey(this.maid.status.noonWorkId))
- {
- return null;
- }
- return ScheduleCSVData.AllData[this.maid.status.noonWorkId].icon;
- }
- }
- public Texture2D night_icon
- {
- get
- {
- if (this.night_icon_name == null)
- {
- return null;
- }
- return this.textureBank.GetTexture(this.night_icon_name);
- }
- }
- public string night_icon_name
- {
- get
- {
- if (!ScheduleCSVData.AllData.ContainsKey(this.maid.status.nightWorkId))
- {
- return null;
- }
- return ScheduleCSVData.AllData[this.maid.status.nightWorkId].icon;
- }
- }
- public Maid Maid
- {
- get
- {
- return this.maid;
- }
- }
- public virtual void Update()
- {
- this._maid = GameMain.Instance.CharacterMgr.status.GetScheduleSlot(this.slotId);
- this.UpdateRankIcon();
- }
- protected void UpdateRankIcon()
- {
- this._popular_rank_icon = null;
- if (this._maid != null && this.textureBank != null)
- {
- int popular_rank = this.popular_rank;
- if (popular_rank != 1)
- {
- if (popular_rank != 2)
- {
- if (popular_rank == 3)
- {
- this._popular_rank_icon = this.textureBank.GetTexture("cm3d2_management_crown_bronze");
- }
- }
- else
- {
- this._popular_rank_icon = this.textureBank.GetTexture("cm3d2_management_crown_silver");
- }
- }
- else
- {
- this._popular_rank_icon = this.textureBank.GetTexture("cm3d2_management_crown_gold");
- }
- }
- }
- protected Maid _maid;
- protected int _slotId;
- protected Texture2D _popular_rank_icon;
- public TextureBank textureBank;
- private const string POPULAR_RANK_ICON_1 = "cm3d2_management_crown_gold";
- private const string POPULAR_RANK_ICON_2 = "cm3d2_management_crown_silver";
- private const string POPULAR_RANK_ICON_3 = "cm3d2_management_crown_bronze";
- }
- }
|