public void InitializeFromDataset(ToolDataset dataset) { try { Texture = game.Content.Load <Texture2D>(Path.Combine("Tools", dataset.AssetName)); } catch { Texture = null; } PowerUpComponent powComponent = new PowerUpComponent(this, dataset.MinPow, dataset.MaxPow, dataset.PowTimestep); //TODO temp Size = new Size(32, 32); Components.AddComponent(powComponent); ScriptEngine scriptEngine = game.Components.First( c => c is ScriptEngine) as ScriptEngine; Behaviour = scriptEngine.GetScript <ToolBehaviourScript>( new ScriptBuilder(dataset.Behaviour, new object[] { game, this })); Behaviour.Initialize(); }
public PowerupRecievedPacket(PowerUpComponent powerUpComponent, ulong id) { Powerup = powerUpComponent; EntityID = id; }