Class: Reve::Classes::KillAttacker

Inherits:
Object
  • Object
show all
Defined in:
lib/reve/classes.rb

Overview

It’s possible to be killed/attacked by an NPC. In this case character_id, character_name, alliance_id, alliance_name and weapon_type_id will be nil Represents an attacker (attacking a KillVictim) in a Kill Attributes

  • id ( Fixnum | NilClass ) - ID of the attacker; nil if the attacker was an NPC or not a Character

  • name ( String | NilClass ) - Name of the attacker; nil if the attacker was an NPC or not a Character

  • corporation_id ( Fixnum ) - ID of the Corporation that the Character belongs to (could be NPC Corporation!)

  • corporation_name ( String ) - Name of the Corporation that the Character belongs to (could be NPC Corporation!)

  • alliance_id ( Fixnum | NilClass ) - ID of the Alliance that the Character belongs to (nil if the KillAttacker doesn’t belong to an Alliance)

  • security_status ( Float ) - Security status of the KillAttacker

  • damage_done ( Fixnum ) - How much damage the KillAttacker did.

  • final_blow ( Boolean ) - True if this KillAttacker got the final blow to kill the KillVictim

  • weapon_type_id ( Fixnum | NilClass ) - Type ID of the (a?) weapon the KillAttacker was firing. (Refer to CCP database dump invtypes)

  • ship_type_id ( Fixnum ) - Type ID of the ship the KillAttacker was flying. (Refer to CCP database dump invtypes)

See Also: Kill, KillLoss, KillVictim, Reve::API#personal_kills, Reve::API#corporate_kills

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elem) ⇒ KillAttacker

:nodoc:



375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
# File 'lib/reve/classes.rb', line 375

def initialize(elem) #:nodoc:
  @id = elem['characterID'] == "0" ? nil : elem['characterID'].to_i
  @name = elem['characterName'].empty? ? nil : elem['characterName']
  @corporation_id = elem['corporationID'].to_i
  @corporation_name = elem['corporationName']
  @alliance_id = elem['allianceID'] == "0" ? nil : elem['allianceID'].to_i
  @alliance_name = elem['allianceName'].empty? ? nil : elem['allianceName']
  @faction_id = elem['factionID'] == "0" ? nil : elem['factionID'].to_i
  @faction_name = elem['factionName'].empty? ? nil : elem['factionName']
  @security_status = elem['securityStatus'].to_f
  @damage_done = elem['damageDone'].to_i
  @final_blow = elem['finalBlow'] == "1"
  @weapon_type_id = elem['weaponTypeID'] == "0" ? nil : elem['weaponTypeID'].to_i
  @ship_type_id = elem['shipTypeID'].to_i
end

Instance Attribute Details

#alliance_idObject (readonly)

Returns the value of attribute alliance_id.



373
374
375
# File 'lib/reve/classes.rb', line 373

def alliance_id
  @alliance_id
end

#alliance_nameObject (readonly)

Returns the value of attribute alliance_name.



373
374
375
# File 'lib/reve/classes.rb', line 373

def alliance_name
  @alliance_name
end

#corporation_idObject (readonly)

Returns the value of attribute corporation_id.



373
374
375
# File 'lib/reve/classes.rb', line 373

def corporation_id
  @corporation_id
end

#corporation_nameObject (readonly)

Returns the value of attribute corporation_name.



373
374
375
# File 'lib/reve/classes.rb', line 373

def corporation_name
  @corporation_name
end

#damage_doneObject (readonly)

Returns the value of attribute damage_done.



373
374
375
# File 'lib/reve/classes.rb', line 373

def damage_done
  @damage_done
end

#faction_idObject (readonly)

Returns the value of attribute faction_id.



373
374
375
# File 'lib/reve/classes.rb', line 373

def faction_id
  @faction_id
end

#faction_nameObject (readonly)

Returns the value of attribute faction_name.



373
374
375
# File 'lib/reve/classes.rb', line 373

def faction_name
  @faction_name
end

#final_blowObject (readonly)

Returns the value of attribute final_blow.



373
374
375
# File 'lib/reve/classes.rb', line 373

def final_blow
  @final_blow
end

#idObject (readonly)

Returns the value of attribute id.



373
374
375
# File 'lib/reve/classes.rb', line 373

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



373
374
375
# File 'lib/reve/classes.rb', line 373

def name
  @name
end

#security_statusObject (readonly)

Returns the value of attribute security_status.



373
374
375
# File 'lib/reve/classes.rb', line 373

def security_status
  @security_status
end

#ship_type_idObject (readonly)

Returns the value of attribute ship_type_id.



373
374
375
# File 'lib/reve/classes.rb', line 373

def ship_type_id
  @ship_type_id
end

#weapon_type_idObject (readonly)

Returns the value of attribute weapon_type_id.



373
374
375
# File 'lib/reve/classes.rb', line 373

def weapon_type_id
  @weapon_type_id
end