/// <summary> /// Loads this scene node from a given binary reader. /// </summary> /// <param name="reader">Binary reader to load this scene node from.</param> public override void Load(BinaryReader reader) { // Load all the basic entity details. base.Load(reader); // Load all the emitter specific details. _speed = new StartFinishF(reader.ReadSingle(), reader.ReadSingle()); _delay = reader.ReadInt32(); _nextNodeName = reader.ReadString(); }
/// <summary> /// Initializes a new instance of this class. /// </summary> /// <param name="entity">Entity that will be moving.</param> /// <param name="x">X position to move to.</param> /// <param name="y">Y position to move to.</param> /// <param name="speed">Speed at which entity moves.</param> public EntityMoveToProcess(EntityNode entity, float x, float y, StartFinishF speed) { _entity = entity; _followSpeed = speed; _x = x; _y = y; Transformation entityTransform = _entity.CalculateTransformation(); float vectorX = entityTransform.X - _x; float vectorY = entityTransform.Y - _y; _originalDistance = (float)Math.Sqrt(vectorX * vectorX + vectorY * vectorY); }
/// <summary> /// Initializes a new instance and gives it the specified /// name. /// </summary> /// <param name="name">Name to name as node to.</param> /// <param name="speed">Starting and finishing speed of this path marker.</param> public PathMarkerNode(string name, StartFinishF speed) { _name = name; _speed = Speed; _visible = false; }