本文整理汇总了Python中objects.Object.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Object.__init__方法的具体用法?Python Object.__init__怎么用?Python Object.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类objects.Object
的用法示例。
在下文中一共展示了Object.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import __init__ [as 别名]
def __init__(self, x, y, char, name, color, slot, power_bonus=0, defense_bonus=0, max_hp_bonus=0):
Object.__init__(self, x, y, char, name, color, blocks=False, always_visible=False)
self.slot = slot
self.is_equipped = False
self.power_bonus = power_bonus
self.defense_bonus = defense_bonus
self.max_hp_bonus = max_hp_bonus
示例2: __init__
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import __init__ [as 别名]
def __init__(self, parent_context, param_list, statements):
import proto_functions
Object.__init__(self, prototype=proto_functions.function_proto)
self.parent_context = parent_context
self.param_list = param_list
self.statements = statements
self.constructing_prototype = Object()
示例3: __init__
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import __init__ [as 别名]
def __init__(self, sequence, \
id, type, name, \
size, \
posx, posy, posz, \
velx, vely, velz, \
contains, \
order_types, \
order_number, \
modify_time, \
owner, ships, damage):
Object.__init__(self, sequence, \
id, type, name, \
size, \
posx, posy, posz, \
velx, vely, velz, \
contains, \
order_types, \
order_number, \
modify_time)
self.length += 4 + 4 + len(ships) * 8 + 4
self.owner = owner
self.ships = ships
self.damage = damage
示例4: __init__
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import __init__ [as 别名]
def __init__(self, sequence, \
id, type, name, \
size, \
posx, posy, posz, \
velx, vely, velz, \
contains, \
order_types, \
order_number, \
modify_time, \
owner, resources):
Object.__init__(self, sequence, \
id, type, name, \
size, \
posx, posy, posz, \
velx, vely, velz, \
contains, \
order_types, \
order_number, \
modify_time)
self.length += 4 + 4 + 16 * len(resources)
self.owner = owner
for r in resources:
if len(r) != 4:
raise TypeError("Resources should be 4 length, <id> <surface> <minable> <inaccess>")
self.resources = resources
示例5: __init__
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import __init__ [as 别名]
def __init__( self, stats, ai, xp, yp, zp=0, ori=0.0, xi=0, yi=0, zi=0, ri=0, thrust=0 ):
Object.__init__( self, stats, xp, yp, zp, ori, xi, yi, zi, ri )
self.alive = True
self.maxOri = 2*pi
self.thrust = thrust
self.rg = 0
self.shieldVsMass = self.stats.shieldVsMass
self.shieldVsEnergy = self.stats.shieldVsEnergy
self.hullVsMass = self.stats.hullVsMass
self.hullVsEnergy = self.stats.hullVsEnergy
self.ai = ai
self.dockedTo = False
self.dockedAt = 0 # tick at docking
self.hull = stats.maxHull
self.shield = stats.maxShield
self.inertiaControl = True
self.headed = True # differentiate bases from ships
self.pulsedUntil = -1000
self.inNebula = False # variable state
self.inertiaMod = 1
self.thrustBoost = 0
self.shipyards = [] # list of regulard shipyards
self.guestDocked = [] # list of temporary docks
示例6: __init__
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import __init__ [as 别名]
def __init__(self, x, y, char, name, color, blocks=True, ai=None, always_visible=False,
equipment=None, character_class=None, creature_type=None, xp=0, screen=None):
#call super constructor to create the map object
Object.__init__(self, x, y, char, name, color, blocks=blocks, always_visible=always_visible)
self.character_class = character_class
if self.character_class:
# let the fighter component know who owns it
self.character_class.owner = self
self.screen = screen
if self.screen:
# set the screen element in the character_class
self.character_class.screen = screen
self.ai = ai
if self.ai:
# let the ai component know who owns it
self.ai.owner = self
self.xp = xp
self.dead = False
self.inventory = []
#set the default equipment dictionary.
self.equipment = {'head': None, 'body':None, 'legs':None, 'hands':None, 'feet':None, 'left hand': None, 'right hand': None}
self.player = None
示例7: __init__
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import __init__ [as 别名]
def __init__(self, model, shape, element, lvl, duration, damage):
Object.__init__(self, model, shape, element)
self.duration = duration
self.elapsed = 0.0
self.lvl = lvl
self.damage = damage
示例8: __init__
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import __init__ [as 别名]
def __init__(self, position):
Object.__init__(self)
self.frame = 0
self._position = position
self.frames = self._cls_frames[:]
self.frames_count = len(self.frames)
self._current_frame_time = 0
self._finished = False
self.load_frame()
示例9: __init__
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import __init__ [as 别名]
def __init__(self, model, shape, element, lvl, damage, target_obj, attract_v):
Object.__init__(self, model, shape, element)
self.lvl = lvl
self.damage = damage
self.target = target_obj
self.velocity = attract_v
self.dir = Vector3d(0.,0.,0.)
示例10: __init__
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import __init__ [as 别名]
def __init__(self, model, shape, element, level):
Object.__init__(self, model, shape, element)
cfg = Config('physics','Ship')
self.move_force_sz = cfg.get('move_force')
self.spin_velocity = cfg.get('spin_velocity')
self.strafe_force = cfg.get('strafe_force')
self.shape.forces_res.append(cfg.get('vacuum_resistance'))
self.breake_rate = cfg.get('breake_rate')
self.mouse_sensivity = Config('game','Mouse').get('sensivity')
self.level = level
self.rotation = Quaternion.from_axis_rotations(0.,0.,0.)
self.ship_dir = None
self.up_dir = None
self.spinning = {
'up' : False,
'down' : False,
'left' : False,
'right' : False
}
self.vectors = {
'up' : (Vector3d.x_axis(), 1.),
'down' : (Vector3d.x_axis(), -1.),
'left' : (Vector3d.y_axis(), 1.),
'right' : (Vector3d.y_axis(), -1.)
}
self.strafe = {
'forward': False,
'left' : False,
'right' : False,
'breake' : False
}
self.strafe_vectors = {
'forward':Vector3d(0.,0.,-0.7),
'left' : Vector3d(-0.9,0.,0.),
'right' : Vector3d(0.9,0.,0.),
'breake' : Vector3d(0.,0.,1.)
}
self.angles = [0.,0.]
self.mouse_target = [0.,0.]
self.collision_set = set()
self.keep_colliding = set()
示例11: __init__
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import __init__ [as 别名]
def __init__(self, map, con, x,y, char, color, fighter=None, level=None):
Object.__init__(self, None, con, x,y, char,
libtcod.namegen_generate('Celtic male'), color, True, fighter=fighter, level=level
)
map.player = self
self.inventory = Inventory()
self.mods = Inventory()
class Item:
stack_limit = 5
obj = Object(None, con, None,None, 'b', 'boost', color, item=Item())
obj.mod = mods.Boost()
self.mods.add_item(obj)
示例12: __init__
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import __init__ [as 别名]
def __init__(self, sequence, \
id, type, name, \
size, \
posx, posy, posz, \
velx, vely, velz, \
contains, \
order_types, \
order_number,
modify_time):
Object.__init__(self, sequence, \
id, type, name, \
size, \
posx, posy, posz, \
velx, vely, velz, \
contains, \
order_types, \
order_number, \
modify_time)
示例13: __init__
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import __init__ [as 别名]
def __init__(self, sequence, \
id, type, name, \
size, \
startx, starty, startz, \
velx, vely, velz, \
contains, \
order_types, \
order_number, \
modify_time, \
endx, endy, endz):
Object.__init__(self, sequence, \
id, type, name, \
size, \
startx, starty, startz, \
velx, vely, velz, \
contains, \
order_types, \
order_number, \
modify_time)
self.length += 8*3
self.start = self.pos
self.end = (endx, endy, endz)
示例14: __init__
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import __init__ [as 别名]
def __init__(self, model, shape, element):
Object.__init__(self, model, shape, element)
self.asteroid_type = None
self.shot_tick_interval = 100
self.shot_tick_counter = 0
self.shot = False
示例15: __init__
# 需要导入模块: from objects import Object [as 别名]
# 或者: from objects.Object import __init__ [as 别名]
def __init__(self, num):
import proto_functions
Object.__init__(self, prototype=proto_functions.num_proto)
self.num = num