protected override void OnMouseDown(MouseEventArgs e) {
			this.selectedEntity = this.getEntity(e.X, e.Y + this.scrolling.Value);

			if (selectedEntity != null) {
				onTemplateSelected.SafeInvoke(this, EventArgs.Empty);
			}

			base.OnMouseDown(e);
		}
Beispiel #2
0
		public AddEntityAction(EntityTemplate model, Vector2 position)
			: this() {
			this.model = model;
			this.position = position;

			Map map = EditorEngine.Instance.CurrentMap;

			this.worldEntity = model.CreateEntity(map.Factory);
			this.worldEntity.Position = position * new Vector2(16, 16);
		}
Beispiel #3
0
		public IEncodable Decode(General.Encoding.BinaryInput stream) {
			position = stream.ReadVector2();
			modelName = stream.ReadString();
			entityIndex = stream.ReadInt32();
			
			if (!string.IsNullOrEmpty(modelName)) {
				World world = EditorEngine.Instance.World;
				model = EditorEngine.Instance.GetModelByName(modelName);
			}

			EntityIO io = new EntityIO(stream, EditorEngine.Instance.CurrentMap.Factory, true);
			this.worldEntity = io.Read();

			return this;
		}
Beispiel #4
0
		public void addObject(EntityTemplate template) {
			World.EntityContainer.Add(template);
		}
Beispiel #5
0
		public ControlEntityEditor() {
			selection = new Selection();
			Template = new EntityTemplate();
		}
Beispiel #6
0
 public void Remove(EntityTemplate template)
 {
     Templates.Remove(template);
 }
Beispiel #7
0
 public void Add(EntityTemplate template)
 {
     this.Templates.Add(template);
 }
Beispiel #8
0
		public void Remove(EntityTemplate template) {
			Templates.Remove(template);
		}
Beispiel #9
0
		public void Add(EntityTemplate template) {
			this.Templates.Add(template);
		}