public void Paste() { if (this.Initialized) { MemoryStream stream = null; IDataObject obj = Clipboard.GetDataObject(); const string format = "aeon_entities"; if (obj.GetDataPresent(format)) { stream = obj.GetData(format) as MemoryStream; } EntitySelectionTool.Instance.SelectedEntities.Clear(); BinaryInput bin = new BinaryInput(stream); int c = bin.ReadInt32(); for (int i = 0; i < c; i++) { int temp_index = bin.ReadInt32(); int x = (int)bin.ReadSingle() >> 4; int y = (int)bin.ReadSingle() >> 4; AddEntityAction act = new AddEntityAction(EditorEngine.Instance.World.EntityContainer.All()[temp_index], new Vector2(x, y)); EditorEngine.Instance.GetActionManager().Execute(act); MapEntity result = act.worldEntity; EntitySelectionTool.Instance.SelectedEntities.Add(result); } } }
public IEncodable Decode(BinaryInput stream) { this.Uid = stream.ReadString(); this.Elapsed = stream.ReadSingle(); this.Duration = stream.ReadSingle(); return(this); }
public ISerializable Deserialize(BinaryInput input) { Name = input.ReadString(); TimePerFrame = input.ReadSingle(); Frames = input.ReadList<KeyFrame>(); AnimationFlag = (AnimationFlags) input.ReadByte(); FlipEffect = (SpriteEffects) input.ReadByte(); Rotation = input.ReadSingle(); return this; }
public override IEncodable Decode(BinaryInput stream) { base.Decode(stream); value = stream.ReadSingle(); return(this); }
public override IEncodable Decode(BinaryInput stream) { base.Decode(stream); TemplateID = stream.ReadInt32(); Collidable = stream.ReadBoolean(); Shadow = stream.ReadBoolean(); Rotation = stream.ReadSingle(); Scale = stream.ReadSingle(); Opacity = stream.ReadSingle(); TopMost = stream.ReadBoolean(); Color = new Color(stream.ReadVector4()); return(this); }
public IEncodable Decode(BinaryInput stream) { this.spriteindex = stream.ReadInt32(); this.collidable = stream.ReadBoolean(); this.reflecting = stream.ReadBoolean(); this.animated = stream.ReadBoolean(); this.frames = stream.ReadInt32(); this.timeperframe = stream.ReadSingle(); this.DefaultBehavior = stream.ReadObject<MockupTileBehavior>(); return this; }
public IEncodable Decode(BinaryInput stream) { this.Name = stream.ReadString(); this.TimePerFrame = stream.ReadSingle(); this.Flags = (AnimationFlags) stream.ReadByte(); int count = stream.ReadInt32(); for (int i = 0; i < count; i++) { this.Indices.Add(stream.ReadInt32()); } return this; }
public IEncodable Decode(BinaryInput stream) { this.spriteindex = stream.ReadInt32(); this.collidable = stream.ReadBoolean(); this.reflecting = stream.ReadBoolean(); this.animated = stream.ReadBoolean(); this.frames = stream.ReadInt32(); this.timeperframe = stream.ReadSingle(); this.DefaultBehavior = stream.ReadObject <MockupTileBehavior>(); return(this); }
public IEncodable Decode(BinaryInput stream) { this.Name = stream.ReadString(); this.TimePerFrame = stream.ReadSingle(); this.Flags = (AnimationFlags)stream.ReadByte(); int count = stream.ReadInt32(); for (int i = 0; i < count; i++) { this.Indices.Add(stream.ReadInt32()); } return(this); }
public IEncodable Decode(BinaryInput stream) { this.Uid = stream.ReadString(); this.Elapsed = stream.ReadSingle(); this.Duration = stream.ReadSingle(); return this; }
public override IEncodable Decode(BinaryInput stream) { base.Decode(stream); TemplateID = stream.ReadInt32(); Collidable = stream.ReadBoolean(); Shadow = stream.ReadBoolean(); Rotation = stream.ReadSingle(); Scale = stream.ReadSingle(); Opacity = stream.ReadSingle(); TopMost = stream.ReadBoolean(); Color = new Color(stream.ReadVector4()); return this; }