Esempio n. 1
0
        /// <summary>
        /// 如果用简单工厂
        /// </summary>
        /// <param name="className"></param>
        private void button2_Encapsulation(string className)
        {
            IEquip e3   = EquipSimpleFactory.CreateFactory(className);
            string str1 = e3.GetName();

            Invoke(new show(showTextbox), new object[] { str1 });
        }
Esempio n. 2
0
 public Commands(
     IMovement movement,
     IRoomActions roomActions,
     IDebug debug,
     ISkills skills,
     ISpells spells,
     IObject objects,
     IInventory inventory,
     Icommunication communication,
     IEquip equipment,
     IScore score,
     ICombat combat,
     ICache cache,
     ISocials socials,
     ICommandHandler commandHandler
     )
 {
     _movement       = movement;
     _roomActions    = roomActions;
     _debug          = debug;
     _skills         = skills;
     _spells         = spells;
     _object         = objects;
     _inventory      = inventory;
     _communication  = communication;
     _equipment      = equipment;
     _score          = score;
     _combat         = combat;
     _cache          = cache;
     _socials        = socials;
     _commandHandler = commandHandler;
 }
Esempio n. 3
0
 public PassiveSkills(IWriteToClient writer, IUpdateClientUI updateClientUi, IDice dice, IDamage damage, ICombat fight, ISkillManager skillManager, ICache cache, IGain gain, IEquip equip)
 {
     _writer         = writer;
     _updateClientUi = updateClientUi;
     _dice           = dice;
     _damage         = damage;
     _fight          = fight;
     _skillManager   = skillManager;
     _cache          = cache;
     _gain           = gain;
     _equip          = equip;
 }
Esempio n. 4
0
 public Commands(
     IMovement movement,
     IRoomActions roomActions,
     IDebug debug,
     ISkills skills,
     ISpells spells,
     IObject objects,
     IInventory inventory,
     Icommunication communication,
     IEquip equipment,
     IScore score,
     ICombat combat,
     ICache cache,
     ISocials socials,
     ICommandHandler commandHandler,
     ICore core,
     IMobFunctions mobFunctions,
     IHelp help,
     IMobScripts mobScripts,
     ICrafting crafting,
     ICooking cooking,
     IUtilSkills utilSkills,
     IPassiveSkills passiveSkills,
     IHealer healer
     )
 {
     _movement       = movement;
     _roomActions    = roomActions;
     _debug          = debug;
     _skills         = skills;
     _spells         = spells;
     _object         = objects;
     _inventory      = inventory;
     _communication  = communication;
     _equipment      = equipment;
     _score          = score;
     _combat         = combat;
     _cache          = cache;
     _socials        = socials;
     _commandHandler = commandHandler;
     _core           = core;
     _mobFunctions   = mobFunctions;
     _help           = help;
     _mobScripts     = mobScripts;
     _crafting       = crafting;
     _cooking        = cooking;
     _utilSkills     = utilSkills;
     _passiveSkills  = passiveSkills;
     _healer         = healer;
 }
Esempio n. 5
0
        private string GetEquipNameOnCurrentLanguate(IEquip entity)
        {
            var name = entity.Name;

            if (userLanguage == "en")
            {
                name = entity.NameEng;
            }

            if (userLanguage == "kk")
            {
                name = entity.NameKZ;
            }

            return(name);
        }
Esempio n. 6
0
        public static IEquip CreateFactory(string name)
        {
            switch (name)
            {
            case "gps":
                factory = new Gps();
                break;

            case "imu":
                factory = new IMU();
                break;

            default:
                throw new NotImplementedException();
            }
            return(factory);
        }
Esempio n. 7
0
 /// <summary>
 /// 切换装备,如果没有装备则不显示,效率快
 /// </summary>
 /// <param name="equip"></param>
 public void UpdateFit(IEquip equip)
 {
     if (equip == null)  // 为空
     {
         gameObject.SetActive(false);
         hasItem = false;
         return;
     }
     if (equip == Equip)    // 未修改
     {
         return;
     }
     Equip          = equip;
     gridImg.sprite = Equip.GetIcon();
     hasItem        = true;
     gameObject.SetActive(true);
 }
Esempio n. 8
0
        public void ShowItemData(int fitId, Vector3 pos)
        {
            if (fitId < 0 || fitId > Fits.Length)
            {
                return;
            }
            IEquip equip = Fits[fitId].Equip;
            string str   = string.Empty;

            if (equip == null)
            {
                return;
            }
            ItemName.text = equip.Name;
            if (equip.Detail != string.Empty)
            {
                str += equip.Detail;
            }
            if (equip.Attack > 0)
            {
                str += "\n" + "<color=#62BEFFFF>ATT</color> +" + equip.Attack;
            }
            if (equip.Defend > 0)
            {
                str += "\n" + "<color=#62BEFFFF>DEF</color> +" + equip.Defend;
            }
            if (equip.HP > 0)
            {
                str += "\n" + "<color=#62BEFFFF>HP</color> +" + equip.HP;
            }
            if (equip.SP > 0)
            {
                str += "\n" + "<color=#62BEFFFF>SP</color> +" + equip.SP;
            }
            ItemDetail.text         = str;
            Info.transform.position = pos;
            Info.gameObject.SetActive(true);
        }
Esempio n. 9
0
        private void button3_Click(object sender, EventArgs e)
        {
            #region 教程的版本

            // 如果客户又想点肉末茄子了
            // 再另外初始化一个肉末茄子工厂
            Creator minceMeatEggplantFactor = new MincedMeatEggplantFactory();

            // 利用肉末茄子工厂来创建肉末茄子这道菜
            Food minceMeatEggplant = minceMeatEggplantFactor.CreateFoddFactory();
            minceMeatEggplant.Print();

            Invoke(new show(showTextbox), new object[] { minceMeatEggplant.FoodName });

            #endregion

            #region 自己的版本

            IEquipCreator IEC;
            string        str1;
            //已经有了gps和imu类
            IEC = new GpsFactory();
            IEquip _gps = IEC.CreateFactory();
            str1 = _gps.GetName();
            Invoke(new show(showTextbox), new object[] { str1 });

            IEC = new IMUFactory();
            IEquip _imu = IEC.CreateFactory();
            str1 = _imu.GetName();
            Invoke(new show(showTextbox), new object[] { str1 });
            //现在新增camera类,新增和调用时都不需要对原有类进行修改
            IEC = new CameraFactory();
            IEquip _camera = IEC.CreateFactory();
            str1 = _camera.GetName();
            Invoke(new show(showTextbox), new object[] { str1 });

            #endregion
        }
Esempio n. 10
0
 //private constructor because inventory is a singleton
 private Inventory(Player player)
 {
     this.player    = player;
     equipBehaviour = new EquipFlashLight(player, this);
 }
Esempio n. 11
0
 public MountLoadTask(EPartType p, IEquip e) : base(p)
 {
     component = e;
 }
Esempio n. 12
0
 // 把单个组件添加到组件集合中
 public void Add(IEquip part)
 {
     parts.Add(part);
 }
Esempio n. 13
0
 public PartLoadTask(EPartType p, IEquip equip)
     : base(p)
 {
     m_equip = equip;
 }