Exemple #1
0
 public override void Construct(Blob arguments, EntityUniverseFacade entityUniverseFacade)
 {
     _configuration = GameContext.TileDatabase.GetTileConfiguration(arguments.GetString("tile"));
     Component      = _configuration.Components.GetOrDefault <CenterComponentBuilder.CenterTotemComponent>();
     Location       = arguments.FetchBlob("location").GetVector3I();
     _variant       = (uint)arguments.GetLong("variant");
     Entity.Physics.Construct(arguments.FetchBlob("position").GetVector3D(), Vector3D.Zero);
     Entity.Physics.MakePhysicsless();
     _ballSpawned = true;
     _ball        = GameContext.ItemDatabase.SpawnItem(Component.SoccerBall, null);
 }
Exemple #2
0
 public override void Restore()
 {
     base.Restore();
     Location             = _blob.FetchBlob("location").GetVector3I();
     _variant             = (uint)_blob.GetLong("variant");
     _done                = _blob.GetBool("done");
     _configuration       = GameContext.TileDatabase.GetTileConfiguration(_blob.GetString("tile"));
     Component            = _configuration.Components.Get <CenterComponentBuilder.CenterTotemComponent>();
     _ballSpawned         = _blob.GetBool("ballSpawned", true);
     RoundStartedTimestep = _blob.GetTimestep("roundStartedTimestep", Timestep.Null);
 }