public static SkillWrapper Parse(ByteBuffer buffer) { string content = buffer.ReadUTF(); SkillWrapper wrapper = new SkillWrapper(); wrapper.Params = StringConvert.StringToParams(content); return(wrapper); }
public override void ReadByte(ByteBuffer byteBuf) { Id = byteBuf.ReadInt(); IsLeader = byteBuf.ReadBool(); Race = StringConvert.IndexToEnum <ERaceType>(byteBuf.ReadInt()); Name = LANG.Convert(byteBuf.ReadInt()); Model = byteBuf.ReadUTF(); Age = byteBuf.ReadInt(); Power = byteBuf.ReadLong(); Speed = byteBuf.ReadFloat(); Hp = byteBuf.ReadDouble(); SomeIntParams = byteBuf.ReadListInt(); SomeLongParams = byteBuf.ReadListLong(); SomeFloatParams = byteBuf.ReadListFloat(); SomeDoubleParams = byteBuf.ReadListDouble(); SomeStringParams = byteBuf.ReadListUTF(); SomeLanguageParams = LANG.Convert(byteBuf.ReadListInt()); SkillWrapper = SkillWrapper.Parse(byteBuf); }
/// <summary> /// Triggered when a skill is selected from the skill tab at the top of the window /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void UISkillTabs_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (UISkillTabs.SelectedIndex < 0) { return; } // Clear any previous results UIResultPanel.Items.Clear(); // Prevent premature user interaction UIButtonFilePick.IsEnabled = false; m_currentSkillWrapper = m_skillWrappers[UISkillTabs.SelectedIndex]; // Refresh UI with available execution devices on the system supported by the skill m_availableDevices = await m_currentSkillWrapper.Descriptor.GetSupportedExecutionDevicesAsync(); if (m_availableDevices.Count == 0) { await(new MessageDialog("No execution devices available, this skill cannot run on this device")).ShowAsync(); } else { // Display available execution devices and select the CPU by default UISkillExecutionDevices.ItemsSource = m_availableDevices.Select((device) => new SkillExecutionDeviceWrappper(device)); int selectionIndex = -1; for (int i = 0; i < m_availableDevices.Count; i++) { if (m_availableDevices[i].ExecutionDeviceKind == SkillExecutionDeviceKind.Cpu) { selectionIndex = i; break; } } UISkillExecutionDevices.SelectedIndex = selectionIndex; } }
public AbilitySkillWrapper(SkillWrapper p_wrapper) { SkillWrapper = p_wrapper; }