示例#1
0
            public Actions(Entity source) : this()
            {
                id          = source.ID;
                NewPosition = source.ID.Position;
#if STATE_ADV
                newAppearances = source.Appearances?.Duplicate();
#endif
            }
示例#2
0
 public void AddOrReplace(EntityAppearance app)
 {
     if (newAppearances == null)
     {
         newAppearances = new EntityAppearanceCollection();
     }
     newAppearances.AddOrReplace(app);
 }
示例#3
0
        public Entity(EntityID id, Vec3 velocity, EntityLogic dstate, byte[] state
#if STATE_ADV
                      , EntityAppearanceCollection appearance = null
#endif
                      ) : this(id, velocity, dstate, state,
#if STATE_ADV
                               appearance, null,
#endif
                               null)
        {
        }
示例#4
0
        public Entity(EntityID id, Vec3 velocity, EntityLogic state
#if STATE_ADV
                      , EntityAppearanceCollection appearance = null
#endif
                      ) : this(id, velocity, state, Helper.SerializeToArray(state),
#if STATE_ADV
                               appearance, null,
#endif
                               null)
        {
        }
示例#5
0
            public void Instantiate(Vec3 targetLocation, string assemblyName, string logicName, object[] constructorParameters
#if STATE_ADV
                                    , EntityAppearanceCollection appearances
#endif
                                    )
            {
                Instantiate(targetLocation, new DynamicCSLogic(assemblyName, logicName, constructorParameters)
#if STATE_ADV
                            , appearances
#endif
                            );
            }
示例#6
0
            public void Instantiate(Vec3 targetLocation, EntityLogic logic
#if STATE_ADV
                                    , EntityAppearanceCollection appearances
#endif
                                    )
            {
                instantiations.Add(new Instantiation()
                {
#if STATE_ADV
                    appearances = appearances,
#endif
                    logic          = logic,
                    targetLocation = targetLocation
                });
            }
示例#7
0
        public Entity(EntityID id, Vec3 velocity, EntityLogic dstate, byte[] state
#if STATE_ADV
                      , EntityAppearanceCollection appearance, EntityContact[] contacts
#endif
                      , EntityMessage[] messages)   //: this()
        {
            //if (!Simulation.FullSimulationSpace.Contains(id.Position))
            //	throw new IntegrityViolation("New entity location is located outside simulation space: "+id+", "+Simulation.FullSimulationSpace);
            ID                         = id;
            Velocity                   = velocity;
            SerialLogicState           = state ?? Helper.SerializeToArray(dstate);
            transientDeserializedLogic = dstate;
#if STATE_ADV
            Appearances = appearance;
            Contacts    = contacts;
#endif

            InboundMessages = messages;
        }
示例#8
0
 public EntityContact(EntityID id, EntityAppearanceCollection appearances, Vec3 velocity)
 {
     ID          = id;
     Appearances = appearances;
     Velocity    = velocity;
 }