예제 #1
0
        public EquipSelectedScreen(SimulatorContext context, IList <PlayerCharacter> _list, BaseGoods goods) : base(context)
        {
            _goods    = goods;
            list      = _list;
            bg        = Context.Util.GetFrameBitmap(16 * 5 + 6, 6 + 16 * list.Count);
            itemsText = ExtensionFunction.DyadicArrayByte(list.Count, 11);//new byte[list.Count][11];

            for (int i = 0; i < itemsText.Length; i++)
            {
                itemsText[i] = new byte[11];
            }

            for (int i = 0; i < itemsText.Length; i++)
            {
                for (int j = 0; j < 10; j++)
                {
                    itemsText[i][j] = (byte)' ';
                }
                try
                {
                    byte[] tmp = list[i].Name.GetBytes();
                    Array.Copy(tmp, 0, itemsText[i], 0, tmp.Length);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex);
                }
            }
        }
        /// <summary>
        /// 多人装备选择界面
        /// </summary>
        /// <param name="context"></param>
        /// <param name="characters">角色列表</param>
        /// <param name="goods">当前选择进行装备的装备</param>
        public MutilCharacterEquipScreen(SimulatorContext context, List <PlayerCharacter> characters, BaseGoods goods) : base(context)
        {
            //HACK 此处需要测试是否正常运行
            _characters = characters;
            _goods      = goods;

            _background = Context.Util.GetFrameBitmap(16 * 5 + 6, 6 + 16 * _characters.Count);
            _names      = ExtensionFunction.DyadicArrayByte(_characters.Count, 11);//new byte[list.Count][11];
            for (int i = 0; i < _names.Length; i++)
            {
                for (int j = 0; j < 10; j++)
                {
                    _names[i][j] = (byte)' ';
                }
                try
                {
                    byte[] tmp = _characters[i].Name.GetBytes();
                    Array.Copy(tmp, 0, _names[i], 0, tmp.Length);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex);
                }
            }
        }