Beispiel #1
0
        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);
        }
Beispiel #2
0
        void item_OnClick(object sender, EventArgs e)
        {
            if (_selectItem == null)
            {
                return;
            }
            var view = (EntityDescription)sender;
            ScriptEntityDescription selected = (ScriptEntityDescription)view.BindingContext;

            _selectItem.TrySetResult(selected);
        }
Beispiel #3
0
        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;
            }
        }