public bool AddEntity(ScriptEntityDescription entity, Vector2 position, TypeTag tag) { var e = _scriptEntityFactory.LoadEntity(Content, entity, position); e.Tag = tag; Entities = Entities.Add(e); return(true); }
void item_OnClick(object sender, EventArgs e) { if (_selectItem == null) { return; } var view = (EntityDescription)sender; ScriptEntityDescription selected = (ScriptEntityDescription)view.BindingContext; _selectItem.TrySetResult(selected); }
void PlaceEntity(ScriptEntityDescription entity) { Log.Debug(Tag, "Item Selected: " + entity.DisplayName); if (!_sandbox) { foreach (var location in _playerPositions) { AddEntity(entity, location, TypeTag.Player); } _isPaused = false; } else { _mousePressed = true; _currentEntity = entity; Cursor.CurrentState = CursorState.AddEntity; } }