示例#1
0
        public DeusGameObject CreateGameObject(GameObjectCreateArgs args)
        {
            // Create all the components
            List <DeusComponent> components = new List <DeusComponent>();

            foreach (var component in args.ComponentsInfos)
            {
                components.Add(GameComponentFactory.CreateComponent(component, args.GameObjectId));
            }

            // Create the gameobject
            DeusGameObject gameObject = new DeusGameObject(args, components);

            // notify the view that there is a new object to display
            PacketCreateViewObject packet = new PacketCreateViewObject();

            packet.LinkedGameObject = gameObject;
            packet.ObjectId         = gameObject.UniqueIdentifier;
            EventManager.Get().EnqueuePacket(0, packet);

            return(gameObject);
        }
示例#2
0
 public ViewObjectCreateArgs(DeusGameObject linkedGameObject)
 {
     LinkedGameObject = linkedGameObject;
 }