How to use the hearthstone.hslog.packets.Packet function in hearthstone

To help you get started, we’ve selected a few hearthstone examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HearthSim / python-hearthstone / hearthstone / hslog / packets.py View on Github external
class ShowEntity(Packet):
	power_type = PowerType.SHOW_ENTITY

	def __init__(self, ts, entity, card_id):
		self.ts = ts
		self.entity = entity
		self.card_id = card_id
		self.tags = []

	def __repr__(self):
		return "%s(entity=%r, card_id=%r)" % (
			self.__class__.__name__, self.entity, self.card_id
		)


class ChangeEntity(Packet):
	power_type = PowerType.CHANGE_ENTITY

	def __init__(self, ts, entity, card_id):
		self.ts = ts
		self.entity = entity
		self.card_id = card_id
		self.tags = []


class TagChange(Packet):
	power_type = PowerType.TAG_CHANGE

	def __init__(self, ts, entity, tag, value):
		self.ts = ts
		self.entity = entity
		self.tag = tag
github HearthSim / python-hearthstone / hearthstone / hslog / packets.py View on Github external
self.ts = ts
			self.entity = id
			self.player_id = player_id
			self.hi = hi
			self.lo = lo
			self.tags = []
			self.name = None

	def __init__(self, ts, entity):
		self.ts = ts
		self.entity = entity
		self.tags = []
		self.players = []


class HideEntity(Packet):
	power_type = PowerType.HIDE_ENTITY

	def __init__(self, ts, entity, zone):
		self.ts = ts
		self.entity = entity
		self.zone = zone


class FullEntity(Packet):
	power_type = PowerType.FULL_ENTITY

	def __init__(self, ts, entity, card_id):
		self.ts = ts
		self.entity = entity
		self.card_id = card_id
		self.tags = []
github HearthSim / python-hearthstone / hearthstone / hslog / packets.py View on Github external
self.ts = ts
		self.entity = None
		self.id = id
		self.type = type
		self.choices = []


class ChosenEntities(Packet):
	def __init__(self, ts, entity, id):
		self.ts = ts
		self.entity = entity
		self.id = id
		self.choices = []


class Options(Packet):
	def __init__(self, ts, id):
		self.ts = ts
		self.entity = None
		self.id = id
		self.options = []


class Option(Packet):
	def __init__(self, ts, entity, id, type, optype, error, error_param):
		self.ts = ts
		self.entity = entity
		self.id = id
		self.type = type
		self.optype = optype
		self.error = error
		self.error_param = error_param
github HearthSim / python-hearthstone / hearthstone / hslog / packets.py View on Github external
self.ts = ts
		self.entity = entity
		self.zone = zone


class FullEntity(Packet):
	power_type = PowerType.FULL_ENTITY

	def __init__(self, ts, entity, card_id):
		self.ts = ts
		self.entity = entity
		self.card_id = card_id
		self.tags = []


class ShowEntity(Packet):
	power_type = PowerType.SHOW_ENTITY

	def __init__(self, ts, entity, card_id):
		self.ts = ts
		self.entity = entity
		self.card_id = card_id
		self.tags = []

	def __repr__(self):
		return "%s(entity=%r, card_id=%r)" % (
			self.__class__.__name__, self.entity, self.card_id
		)


class ChangeEntity(Packet):
	power_type = PowerType.CHANGE_ENTITY
github HearthSim / python-hearthstone / hearthstone / hslog / packets.py View on Github external
self.ts = ts
		self.entity = entity
		self.id = id
		self.tasklist = tasklist
		self.type = type
		self.min = min
		self.max = max
		self.source = None
		self.choices = []

	@property
	def player(self):
		return self.entity


class SendChoices(Packet):
	def __init__(self, ts, id, type):
		self.ts = ts
		self.entity = None
		self.id = id
		self.type = type
		self.choices = []


class ChosenEntities(Packet):
	def __init__(self, ts, entity, id):
		self.ts = ts
		self.entity = entity
		self.id = id
		self.choices = []
github HearthSim / python-hearthstone / hearthstone / hslog / packets.py View on Github external
class MetaData(Packet):
	power_type = PowerType.META_DATA

	def __init__(self, ts, meta, data, count):
		self.ts = ts
		self.meta = meta
		self.data = data
		self.count = count
		self.info = []

	def __repr__(self):
		return "%s(meta=%r, data=%r)" % (self.__class__.__name__, self.meta, self.data)


class CreateGame(Packet):
	power_type = PowerType.CREATE_GAME

	class Player:
		def __init__(self, ts, id, player_id, hi, lo):
			self.ts = ts
			self.entity = id
			self.player_id = player_id
			self.hi = hi
			self.lo = lo
			self.tags = []
			self.name = None

	def __init__(self, ts, entity):
		self.ts = ts
		self.entity = entity
		self.tags = []
github HearthSim / python-hearthstone / hearthstone / hslog / packets.py View on Github external
def export(self, cls=None):
		if cls is None:
			from .export import EntityTreeExporter as cls
		exporter = cls(self)
		return exporter.export()


class Packet:
	power_type = 0

	def __repr__(self):
		return "<%s>" % (self.__class__.__name__)


class Block(Packet):
	power_type = PowerType.BLOCK_START

	def __init__(self, ts, entity, type, index, effectid, effectindex, target):
		self.ts = ts
		self.entity = entity
		self.type = type
		self.index = index
		self.effectid = effectid
		self.effectindex = effectindex
		self.target = target
		self.ended = False
		self.packets = []

	def __iter__(self):
		for packet in self.packets:
			yield packet
github HearthSim / python-hearthstone / hearthstone / hslog / packets.py View on Github external
def __init__(self, ts, entity, id):
		self.ts = ts
		self.entity = entity
		self.id = id
		self.choices = []


class Options(Packet):
	def __init__(self, ts, id):
		self.ts = ts
		self.entity = None
		self.id = id
		self.options = []


class Option(Packet):
	def __init__(self, ts, entity, id, type, optype, error, error_param):
		self.ts = ts
		self.entity = entity
		self.id = id
		self.type = type
		self.optype = optype
		self.error = error
		self.error_param = error_param
		self.options = []


class SendOption(Packet):
	def __init__(self, ts, option, suboption, target, position):
		self.ts = ts
		self.entity = None
		self.option = option
github HearthSim / python-hearthstone / hearthstone / hslog / packets.py View on Github external
self.ts = ts
		self.entity = entity
		self.tags = []
		self.players = []


class HideEntity(Packet):
	power_type = PowerType.HIDE_ENTITY

	def __init__(self, ts, entity, zone):
		self.ts = ts
		self.entity = entity
		self.zone = zone


class FullEntity(Packet):
	power_type = PowerType.FULL_ENTITY

	def __init__(self, ts, entity, card_id):
		self.ts = ts
		self.entity = entity
		self.card_id = card_id
		self.tags = []


class ShowEntity(Packet):
	power_type = PowerType.SHOW_ENTITY

	def __init__(self, ts, entity, card_id):
		self.ts = ts
		self.entity = entity
		self.card_id = card_id
github HearthSim / python-hearthstone / hearthstone / hslog / packets.py View on Github external
	@property
	def player(self):
		return self.entity


class SendChoices(Packet):
	def __init__(self, ts, id, type):
		self.ts = ts
		self.entity = None
		self.id = id
		self.type = type
		self.choices = []


class ChosenEntities(Packet):
	def __init__(self, ts, entity, id):
		self.ts = ts
		self.entity = entity
		self.id = id
		self.choices = []


class Options(Packet):
	def __init__(self, ts, id):
		self.ts = ts
		self.entity = None
		self.id = id
		self.options = []


class Option(Packet):