Пример #1
0
		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);
		}
Пример #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);
		}
Пример #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;
		}
Пример #4
0
		public void addObject(EntityTemplate template) {
			World.EntityContainer.Add(template);
		}
Пример #5
0
		public ControlEntityEditor() {
			selection = new Selection();
			Template = new EntityTemplate();
		}
Пример #6
0
 public void Remove(EntityTemplate template)
 {
     Templates.Remove(template);
 }
Пример #7
0
 public void Add(EntityTemplate template)
 {
     this.Templates.Add(template);
 }
Пример #8
0
		public void Remove(EntityTemplate template) {
			Templates.Remove(template);
		}
Пример #9
0
		public void Add(EntityTemplate template) {
			this.Templates.Add(template);
		}