/game_client/src/com/jediflasher/game_client/server/messages/CharacterInfoResponse.as
ActionScript | 173 lines | 137 code | 28 blank | 8 comment | 19 complexity | 2746f0ce92b13032c9a2083fee2d0d3e MD5 | raw file
- package com.jediflasher.game_client.server.messages {
- import com.netease.protobuf.*;
- import com.netease.protobuf.fieldDescriptors.*;
- import flash.utils.Endian;
- import flash.utils.IDataInput;
- import flash.utils.IDataOutput;
- import flash.utils.IExternalizable;
- import flash.errors.IOError;
- // @@protoc_insertion_point(imports)
- // @@protoc_insertion_point(class_metadata)
- public dynamic final class CharacterInfoResponse extends com.netease.protobuf.Message {
- public static const CHARACTER_ID:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("com.jediflasher.game_client.server.messages.CharacterInfoResponse.character_id", "characterId", (1 << 3) | com.netease.protobuf.WireType.VARINT);
- private var character_id$field:int;
- private var hasField$0:uint = 0;
- public function removeCharacterId():void {
- hasField$0 &= 0xfffffffe;
- character_id$field = new int();
- }
- public function get hasCharacterId():Boolean {
- return (hasField$0 & 0x1) != 0;
- }
- public function set characterId(value:int):void {
- hasField$0 |= 0x1;
- character_id$field = value;
- }
- public function get characterId():int {
- return character_id$field;
- }
- public static const NAME:FieldDescriptor$TYPE_STRING = new FieldDescriptor$TYPE_STRING("com.jediflasher.game_client.server.messages.CharacterInfoResponse.name", "name", (2 << 3) | com.netease.protobuf.WireType.LENGTH_DELIMITED);
- private var name$field:String;
- public function removeName():void {
- name$field = null;
- }
- public function get hasName():Boolean {
- return name$field != null;
- }
- public function set name(value:String):void {
- name$field = value;
- }
- public function get name():String {
- return name$field;
- }
- public static const XPOS:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("com.jediflasher.game_client.server.messages.CharacterInfoResponse.xPos", "xPos", (3 << 3) | com.netease.protobuf.WireType.VARINT);
- private var xPos$field:int;
- public function removeXPos():void {
- hasField$0 &= 0xfffffffd;
- xPos$field = new int();
- }
- public function get hasXPos():Boolean {
- return (hasField$0 & 0x2) != 0;
- }
- public function set xPos(value:int):void {
- hasField$0 |= 0x2;
- xPos$field = value;
- }
- public function get xPos():int {
- return xPos$field;
- }
- public static const YPOS:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("com.jediflasher.game_client.server.messages.CharacterInfoResponse.yPos", "yPos", (4 << 3) | com.netease.protobuf.WireType.VARINT);
- private var yPos$field:int;
- public function removeYPos():void {
- hasField$0 &= 0xfffffffb;
- yPos$field = new int();
- }
- public function get hasYPos():Boolean {
- return (hasField$0 & 0x4) != 0;
- }
- public function set yPos(value:int):void {
- hasField$0 |= 0x4;
- yPos$field = value;
- }
- public function get yPos():int {
- return yPos$field;
- }
- /**
- * @private
- */
- override public final function writeToBuffer(output:com.netease.protobuf.WritingBuffer):void {
- if (hasCharacterId) {
- com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 1);
- com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, character_id$field);
- }
- if (hasName) {
- com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.LENGTH_DELIMITED, 2);
- com.netease.protobuf.WriteUtils.write$TYPE_STRING(output, name$field);
- }
- if (hasXPos) {
- com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 3);
- com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, xPos$field);
- }
- if (hasYPos) {
- com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 4);
- com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, yPos$field);
- }
- for (var fieldKey:* in this) {
- super.writeUnknown(output, fieldKey);
- }
- }
- /**
- * @private
- */
- override public final function readFromSlice(input:flash.utils.IDataInput, bytesAfterSlice:uint):void {
- var character_id$count:uint = 0;
- var name$count:uint = 0;
- var xPos$count:uint = 0;
- var yPos$count:uint = 0;
- while (input.bytesAvailable > bytesAfterSlice) {
- var tag:uint = com.netease.protobuf.ReadUtils.read$TYPE_UINT32(input);
- switch (tag >> 3) {
- case 1:
- if (character_id$count != 0) {
- throw new flash.errors.IOError('Bad data format: CharacterInfoResponse.characterId cannot be set twice.');
- }
- ++character_id$count;
- characterId = com.netease.protobuf.ReadUtils.read$TYPE_INT32(input);
- break;
- case 2:
- if (name$count != 0) {
- throw new flash.errors.IOError('Bad data format: CharacterInfoResponse.name cannot be set twice.');
- }
- ++name$count;
- name = com.netease.protobuf.ReadUtils.read$TYPE_STRING(input);
- break;
- case 3:
- if (xPos$count != 0) {
- throw new flash.errors.IOError('Bad data format: CharacterInfoResponse.xPos cannot be set twice.');
- }
- ++xPos$count;
- xPos = com.netease.protobuf.ReadUtils.read$TYPE_INT32(input);
- break;
- case 4:
- if (yPos$count != 0) {
- throw new flash.errors.IOError('Bad data format: CharacterInfoResponse.yPos cannot be set twice.');
- }
- ++yPos$count;
- yPos = com.netease.protobuf.ReadUtils.read$TYPE_INT32(input);
- break;
- default:
- super.readUnknown(input, tag);
- break;
- }
- }
- }
- }
- }