コード例 #1
0
ファイル: EntityLogic.cs プロジェクト: IronFox/Shard
            public Actions(Entity source) : this()
            {
                id          = source.ID;
                NewPosition = source.ID.Position;
#if STATE_ADV
                newAppearances = source.Appearances?.Duplicate();
#endif
            }
コード例 #2
0
ファイル: EntityLogic.cs プロジェクト: IronFox/Shard
 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
ファイル: EntityLogic.cs プロジェクト: IronFox/Shard
            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
ファイル: EntityLogic.cs プロジェクト: IronFox/Shard
            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
ファイル: EntityContact.cs プロジェクト: IronFox/Shard
 public EntityContact(EntityID id, EntityAppearanceCollection appearances, Vec3 velocity)
 {
     ID          = id;
     Appearances = appearances;
     Velocity    = velocity;
 }