示例#1
0
        public void MoveComponent(BaseComponent component, FissureEntity destination)
        {
            if (component == null)
            {
                throw new ComponentNotFoundException("Cannot move component to destination, the Component is null");
            }
            if (!HasComponent(component.GetType()))
            {
                throw new ComponentNotFoundException($"Cannot move component {component.GetType().Name} to destination, the Component does not exist in the source");
            }

            destination.AddComponent(component);
            RemoveComponent(component.GetType());
        }
示例#2
0
 private void OnComponentRemoved(FissureEntity entity, BaseComponent component)
 {
     ComponentRemoved?.Invoke(entity, component);
 }