Class: Api::BuildItem

Inherits:
Object
  • Object
show all
Includes:
AbilityRemapable
Defined in:
lib/sc2ai/protocol/_meta_documentation.rb,
lib/sc2ai/protocol/ui_pb.rb

Overview

Protobuf virtual class.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ability_id: nil, build_progress: nil) ⇒ BuildItem

END writers for optional fields



6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
# File 'lib/sc2ai/protocol/ui_pb.rb', line 6230

def initialize(ability_id: nil, build_progress: nil)
  @_bitmask = 0

  if ability_id == nil
    @ability_id = 0
  else
    unless 0 <= ability_id && ability_id <= 4_294_967_295
      raise RangeError,
            "Value (#{ability_id}) for field ability_id is out of bounds (0..4294967295)"
    end
    @_bitmask |= 0x0000000000000001
    @ability_id = ability_id
  end

  if build_progress == nil
    @build_progress = 0.0
  else
    @_bitmask |= 0x0000000000000002
    @build_progress = build_progress
  end
end

Instance Attribute Details

#ability_idObject

optional field readers



6208
6209
6210
# File 'lib/sc2ai/protocol/ui_pb.rb', line 6208

def ability_id
  @ability_id
end

#build_progressObject

Returns the value of attribute build_progress.



6210
6211
6212
# File 'lib/sc2ai/protocol/ui_pb.rb', line 6210

def build_progress
  @build_progress
end

Class Method Details

.decode(buff) ⇒ Object



6197
6198
6199
# File 'lib/sc2ai/protocol/ui_pb.rb', line 6197

def self.decode(buff)
  allocate.decode_from(buff.b, 0, buff.bytesize)
end

.encode(obj) ⇒ Object



6201
6202
6203
# File 'lib/sc2ai/protocol/ui_pb.rb', line 6201

def self.encode(obj)
  obj._encode("".b)
end

Instance Method Details

#_encode(buff) ⇒ Object



6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
# File 'lib/sc2ai/protocol/ui_pb.rb', line 6632

def _encode(buff)
  val = @ability_id
  if val != 0
    buff << 0x08

    while val != 0
      byte = val & 0x7F
      val >>= 7
      byte |= 0x80 if val > 0
      buff << byte
    end
  end

  val = @build_progress
  if val != 0
    buff << 0x15

    [val].pack("e", buffer: buff)
  end

  buff
end

#decode_from(buff, index, len) ⇒ Object



6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
# File 'lib/sc2ai/protocol/ui_pb.rb', line 6264

def decode_from(buff, index, len)
  @_bitmask = 0

  @ability_id = 0
  @build_progress = 0.0

  return self if index >= len
  ## PULL_UINT64
  tag =
    if (byte0 = buff.getbyte(index)) < 0x80
      index += 1
      byte0
    elsif (byte1 = buff.getbyte(index + 1)) < 0x80
      index += 2
      (byte1 << 7) | (byte0 & 0x7F)
    elsif (byte2 = buff.getbyte(index + 2)) < 0x80
      index += 3
      (byte2 << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
    elsif (byte3 = buff.getbyte(index + 3)) < 0x80
      index += 4
      (byte3 << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) |
        (byte0 & 0x7F)
    elsif (byte4 = buff.getbyte(index + 4)) < 0x80
      index += 5
      (byte4 << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) |
        ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
    elsif (byte5 = buff.getbyte(index + 5)) < 0x80
      index += 6
      (byte5 << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) |
        ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
    elsif (byte6 = buff.getbyte(index + 6)) < 0x80
      index += 7
      (byte6 << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) |
        ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) |
        ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
    elsif (byte7 = buff.getbyte(index + 7)) < 0x80
      index += 8
      (byte7 << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) |
        ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) |
        ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
    elsif (byte8 = buff.getbyte(index + 8)) < 0x80
      index += 9
      (byte8 << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) |
        ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) |
        ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) |
        ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
    elsif (byte9 = buff.getbyte(index + 9)) < 0x80
      index += 10

      (byte9 << 63) | ((byte8 & 0x7F) << 56) | ((byte7 & 0x7F) << 49) |
        ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) |
        ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) |
        ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
    else
      raise "integer decoding error"
    end

  ## END PULL_UINT64

  found = true
  while true
    # If we have looped around since the last found tag this one is
    # unexpected, so discard it and continue.
    if !found
      wire_type = tag & 0x7
      case wire_type
      when 0
        i = 0
        while true
          newbyte = buff.getbyte(index)
          index += 1
          break if newbyte.nil? || newbyte < 0x80
          i += 1
          break if i > 9
        end
      when 1
        index += 8
      when 2
        ## PULL_BYTES
        value =
          if (byte0 = buff.getbyte(index)) < 0x80
            index += 1
            byte0
          elsif (byte1 = buff.getbyte(index + 1)) < 0x80
            index += 2
            (byte1 << 7) | (byte0 & 0x7F)
          elsif (byte2 = buff.getbyte(index + 2)) < 0x80
            index += 3
            (byte2 << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
          elsif (byte3 = buff.getbyte(index + 3)) < 0x80
            index += 4
            (byte3 << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) |
              (byte0 & 0x7F)
          elsif (byte4 = buff.getbyte(index + 4)) < 0x80
            index += 5
            (byte4 << 28) | ((byte3 & 0x7F) << 21) |
              ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) |
              (byte0 & 0x7F)
          elsif (byte5 = buff.getbyte(index + 5)) < 0x80
            index += 6
            (byte5 << 35) | ((byte4 & 0x7F) << 28) |
              ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) |
              ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
          elsif (byte6 = buff.getbyte(index + 6)) < 0x80
            index += 7
            (byte6 << 42) | ((byte5 & 0x7F) << 35) |
              ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) |
              ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) |
              (byte0 & 0x7F)
          elsif (byte7 = buff.getbyte(index + 7)) < 0x80
            index += 8
            (byte7 << 49) | ((byte6 & 0x7F) << 42) |
              ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) |
              ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) |
              ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
          elsif (byte8 = buff.getbyte(index + 8)) < 0x80
            index += 9
            (byte8 << 56) | ((byte7 & 0x7F) << 49) |
              ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) |
              ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) |
              ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) |
              (byte0 & 0x7F)
          elsif (byte9 = buff.getbyte(index + 9)) < 0x80
            index += 10

            (byte9 << 63) | ((byte8 & 0x7F) << 56) |
              ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) |
              ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) |
              ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) |
              ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
          else
            raise "integer decoding error"
          end

        buff.byteslice(index, value)
        index += value

        ## END PULL_BYTES
      when 5
        index += 4
      else
        raise "unknown wire type #{wire_type}"
      end
      return self if index >= len
      ## PULL_UINT64
      tag =
        if (byte0 = buff.getbyte(index)) < 0x80
          index += 1
          byte0
        elsif (byte1 = buff.getbyte(index + 1)) < 0x80
          index += 2
          (byte1 << 7) | (byte0 & 0x7F)
        elsif (byte2 = buff.getbyte(index + 2)) < 0x80
          index += 3
          (byte2 << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte3 = buff.getbyte(index + 3)) < 0x80
          index += 4
          (byte3 << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) |
            (byte0 & 0x7F)
        elsif (byte4 = buff.getbyte(index + 4)) < 0x80
          index += 5
          (byte4 << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) |
            ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte5 = buff.getbyte(index + 5)) < 0x80
          index += 6
          (byte5 << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) |
            ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte6 = buff.getbyte(index + 6)) < 0x80
          index += 7
          (byte6 << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) |
            ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) |
            ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte7 = buff.getbyte(index + 7)) < 0x80
          index += 8
          (byte7 << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) |
            ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) |
            ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte8 = buff.getbyte(index + 8)) < 0x80
          index += 9
          (byte8 << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) |
            ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) |
            ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) |
            ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte9 = buff.getbyte(index + 9)) < 0x80
          index += 10

          (byte9 << 63) | ((byte8 & 0x7F) << 56) | ((byte7 & 0x7F) << 49) |
            ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) |
            ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) |
            ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        else
          raise "integer decoding error"
        end

      ## END PULL_UINT64
    end
    found = false

    if tag == 0x8
      found = true
      ## PULL_UINT64
      @ability_id =
        if (byte0 = buff.getbyte(index)) < 0x80
          index += 1
          byte0
        elsif (byte1 = buff.getbyte(index + 1)) < 0x80
          index += 2
          (byte1 << 7) | (byte0 & 0x7F)
        elsif (byte2 = buff.getbyte(index + 2)) < 0x80
          index += 3
          (byte2 << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte3 = buff.getbyte(index + 3)) < 0x80
          index += 4
          (byte3 << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) |
            (byte0 & 0x7F)
        elsif (byte4 = buff.getbyte(index + 4)) < 0x80
          index += 5
          (byte4 << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) |
            ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte5 = buff.getbyte(index + 5)) < 0x80
          index += 6
          (byte5 << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) |
            ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte6 = buff.getbyte(index + 6)) < 0x80
          index += 7
          (byte6 << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) |
            ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) |
            ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte7 = buff.getbyte(index + 7)) < 0x80
          index += 8
          (byte7 << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) |
            ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) |
            ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte8 = buff.getbyte(index + 8)) < 0x80
          index += 9
          (byte8 << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) |
            ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) |
            ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) |
            ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte9 = buff.getbyte(index + 9)) < 0x80
          index += 10

          (byte9 << 63) | ((byte8 & 0x7F) << 56) | ((byte7 & 0x7F) << 49) |
            ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) |
            ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) |
            ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        else
          raise "integer decoding error"
        end

      ## END PULL_UINT64

      @_bitmask |= 0x0000000000000001
      return self if index >= len
      ## PULL_UINT64
      tag =
        if (byte0 = buff.getbyte(index)) < 0x80
          index += 1
          byte0
        elsif (byte1 = buff.getbyte(index + 1)) < 0x80
          index += 2
          (byte1 << 7) | (byte0 & 0x7F)
        elsif (byte2 = buff.getbyte(index + 2)) < 0x80
          index += 3
          (byte2 << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte3 = buff.getbyte(index + 3)) < 0x80
          index += 4
          (byte3 << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) |
            (byte0 & 0x7F)
        elsif (byte4 = buff.getbyte(index + 4)) < 0x80
          index += 5
          (byte4 << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) |
            ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte5 = buff.getbyte(index + 5)) < 0x80
          index += 6
          (byte5 << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) |
            ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte6 = buff.getbyte(index + 6)) < 0x80
          index += 7
          (byte6 << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) |
            ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) |
            ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte7 = buff.getbyte(index + 7)) < 0x80
          index += 8
          (byte7 << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) |
            ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) |
            ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte8 = buff.getbyte(index + 8)) < 0x80
          index += 9
          (byte8 << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) |
            ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) |
            ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) |
            ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte9 = buff.getbyte(index + 9)) < 0x80
          index += 10

          (byte9 << 63) | ((byte8 & 0x7F) << 56) | ((byte7 & 0x7F) << 49) |
            ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) |
            ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) |
            ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        else
          raise "integer decoding error"
        end

      ## END PULL_UINT64
    end
    if tag == 0x15
      found = true
      @build_progress = buff.unpack1("e", offset: index)
      index += 4
      @_bitmask |= 0x0000000000000002
      return self if index >= len
      ## PULL_UINT64
      tag =
        if (byte0 = buff.getbyte(index)) < 0x80
          index += 1
          byte0
        elsif (byte1 = buff.getbyte(index + 1)) < 0x80
          index += 2
          (byte1 << 7) | (byte0 & 0x7F)
        elsif (byte2 = buff.getbyte(index + 2)) < 0x80
          index += 3
          (byte2 << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte3 = buff.getbyte(index + 3)) < 0x80
          index += 4
          (byte3 << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) |
            (byte0 & 0x7F)
        elsif (byte4 = buff.getbyte(index + 4)) < 0x80
          index += 5
          (byte4 << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) |
            ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte5 = buff.getbyte(index + 5)) < 0x80
          index += 6
          (byte5 << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) |
            ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte6 = buff.getbyte(index + 6)) < 0x80
          index += 7
          (byte6 << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) |
            ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) |
            ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte7 = buff.getbyte(index + 7)) < 0x80
          index += 8
          (byte7 << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) |
            ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) |
            ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte8 = buff.getbyte(index + 8)) < 0x80
          index += 9
          (byte8 << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) |
            ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) |
            ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) |
            ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        elsif (byte9 = buff.getbyte(index + 9)) < 0x80
          index += 10

          (byte9 << 63) | ((byte8 & 0x7F) << 56) | ((byte7 & 0x7F) << 49) |
            ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) |
            ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) |
            ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F)
        else
          raise "integer decoding error"
        end

      ## END PULL_UINT64
    end

    return self if index >= len
  end
end

#has_ability_id?Boolean

Returns:

  • (Boolean)


6256
6257
6258
# File 'lib/sc2ai/protocol/ui_pb.rb', line 6256

def has_ability_id?
  (@_bitmask & 0x0000000000000001) == 0x0000000000000001
end

#has_build_progress?Boolean

Returns:

  • (Boolean)


6260
6261
6262
# File 'lib/sc2ai/protocol/ui_pb.rb', line 6260

def has_build_progress?
  (@_bitmask & 0x0000000000000002) == 0x0000000000000002
end

#to_hObject



6655
6656
6657
6658
6659
6660
# File 'lib/sc2ai/protocol/ui_pb.rb', line 6655

def to_h
  result = {}
  result["ability_id".to_sym] = @ability_id
  result["build_progress".to_sym] = @build_progress
  result
end

#to_proto(_options = {}) ⇒ Object



6252
6253
6254
# File 'lib/sc2ai/protocol/ui_pb.rb', line 6252

def to_proto(_options = {})
  self.class.encode(self)
end