Esempio n. 1
0
        private void AddNewWorldEntity(string name, WorldEntity worldEntity)
        {
            worldEntity.NameChanged += new EventHandler(worldEntity_NameChanged);

            if (Engine.World.AddWorldEntity(name, worldEntity))
                this.lstEntityTypes.Items.Add(name);
        }
        public void UpdatingMapEventArgsConstructorTest()
        {
            BaseMap              baseMap    = null; // TODO: 初始化为适当的值
            WorldEntity          gameEntity = null; // TODO: 初始化为适当的值
            UpdatingMapEventArgs target     = new UpdatingMapEventArgs(baseMap, gameEntity);

            Assert.Inconclusive("TODO: 实现用来验证目标的代码");
        }
Esempio n. 3
0
        public void MovedToCallEventArgsConstructorTest()
        {
            Point3D              location   = new Point3D(); // TODO: 初始化为适当的值
            WorldEntity          gameEntity = null;          // TODO: 初始化为适当的值
            MovedToCallEventArgs target     = new MovedToCallEventArgs(location, gameEntity);

            Assert.Inconclusive("TODO: 实现用来验证目标的代码");
        }
Esempio n. 4
0
        public void UpdatedAIEventArgsConstructorTest()
        {
            IArtificialIntelligence artificialIntelligence = null; // TODO: 初始化为适当的值
            WorldEntity             gameEntity             = null; // TODO: 初始化为适当的值
            UpdatedAIEventArgs      target = new UpdatedAIEventArgs(artificialIntelligence, gameEntity);

            Assert.Inconclusive("TODO: 实现用来验证目标的代码");
        }
        public void UpdatingOrientationEventArgsConstructorTest()
        {
            float       orientation             = 0F;   // TODO: 初始化为适当的值
            WorldEntity gameEntity              = null; // TODO: 初始化为适当的值
            UpdatingOrientationEventArgs target = new UpdatingOrientationEventArgs(orientation, gameEntity);

            Assert.Inconclusive("TODO: 实现用来验证目标的代码");
        }
        public void OnUpdatedLocationTest()
        {
            WorldEntityState target     = new WorldEntityState(); // TODO: 初始化为适当的值
            Point3D          point3D    = new Point3D();          // TODO: 初始化为适当的值
            WorldEntity      gameEntity = null;                   // TODO: 初始化为适当的值

            target.OnUpdatedLocation(point3D, gameEntity);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
        public void OnUpdatedMapTest()
        {
            WorldEntityState target     = new WorldEntityState(); // TODO: 初始化为适当的值
            BaseMap          map        = null;                   // TODO: 初始化为适当的值
            WorldEntity      gameEntity = null;                   // TODO: 初始化为适当的值

            target.OnUpdatedMap(map, gameEntity);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
        public void OnUpdatedMapSpaceNodeTest()
        {
            WorldEntityState target       = new WorldEntityState(); // TODO: 初始化为适当的值
            MapSpaceNode     mapSpaceNode = null;                   // TODO: 初始化为适当的值
            WorldEntity      gameEntity   = null;                   // TODO: 初始化为适当的值

            target.OnUpdatedMapSpaceNode(mapSpaceNode, gameEntity);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
        public void OnUpdatedOrientationTest()
        {
            WorldEntityState target      = new WorldEntityState(); // TODO: 初始化为适当的值
            float            orientation = 0F;                     // TODO: 初始化为适当的值
            WorldEntity      gameEntity  = null;                   // TODO: 初始化为适当的值

            target.OnUpdatedOrientation(orientation, gameEntity);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
 public void NewXTest()
 {
     float x = 0F; // TODO: 初始化为适当的值
     WorldEntity gameEntity = null; // TODO: 初始化为适当的值
     UpdatingXEventArgs target = new UpdatingXEventArgs( x, gameEntity ); // TODO: 初始化为适当的值
     float actual;
     actual = target.NewX;
     Assert.Inconclusive( "验证此测试方法的正确性。" );
 }
Esempio n. 11
0
        public void WorldEntityMovedInMapEventArgsConstructorTest()
        {
            Point3D     oldLocation = new Point3D(); // TODO: 初始化为适当的值
            WorldEntity entity      = null;          // TODO: 初始化为适当的值
            BaseMap     map         = null;          // TODO: 初始化为适当的值
            WorldEntityMovedInMapEventArgs target = new WorldEntityMovedInMapEventArgs(oldLocation, entity, map);

            Assert.Inconclusive("TODO: 实现用来验证目标的代码");
        }
Esempio n. 12
0
        public void SubScribeComponentMessageTest()
        {
            WorldEntity      target           = CreateWorldEntity();    // TODO: 初始化为适当的值
            ComponentId      componentId      = new ComponentId();      // TODO: 初始化为适当的值
            ComponentMessage componentMessage = new ComponentMessage(); // TODO: 初始化为适当的值

            target.SubScribeComponentMessage(componentId, componentMessage);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
 public void UpdateFunctionality(WorldEntity BehaviourOwner)
 {
     if (ConsoleText != null && BehaviourOwner is VerticalScrollPane)
     {
         ((VerticalScrollPane)BehaviourOwner).SetAsTextPane(ConsoleText, 100);
         ((VerticalScrollPane)BehaviourOwner).JumpTo(1f);
         ConsoleText = null;
     }
 }
        public void OnUpdatedAITest()
        {
            WorldEntityState        target = new WorldEntityState(); // TODO: 初始化为适当的值
            IArtificialIntelligence artificialIntelligence = null;   // TODO: 初始化为适当的值
            WorldEntity             gameEntity             = null;   // TODO: 初始化为适当的值

            target.OnUpdatedAI(artificialIntelligence, gameEntity);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
Esempio n. 15
0
 /// <summary>
 /// 
 /// </summary>
 internal void OnEnteredMap( WorldEntity worldEntity, BaseMap map )
 {
     EventHandler<WorldEntityEnteredMapEventArgs> tempAfterEventArgs = m_EventWorldEntityEnteredMap;
     if ( tempAfterEventArgs != null )
     {
         WorldEntityEnteredMapEventArgs eventArgs = new WorldEntityEnteredMapEventArgs( worldEntity, map );
         tempAfterEventArgs( this, eventArgs );
     }
 }
Esempio n. 16
0
        public void OnEnteredMapTest2()
        {
            BaseMapState target      = new BaseMapState(); // TODO: 初始化为适当的值
            WorldEntity  worldEntity = null;               // TODO: 初始化为适当的值
            BaseMap      map         = null;               // TODO: 初始化为适当的值

            target.OnEnteredMap(worldEntity, map);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
Esempio n. 17
0
        public WorldBoundingBoxComponent(WorldEntity entity, Vector2 location, Rectangle baseRect) : base(entity)
        {
            //_box = (CollisionBoundingBox)CollisionGeometryFactory.CreateGeometry(CollisionType.BoundingBox);
            _box = new CollisionBoundingBox(location, baseRect);

            Geometry = _box;

            RaiseCreated();
        }
        public void MovedToWorldEventArgsConstructorTest()
        {
            Point3D               oldLocation = new Point3D(); // TODO: 初始化为适当的值
            BaseMap               oldMap      = null;          // TODO: 初始化为适当的值
            WorldEntity           gameEntity  = null;          // TODO: 初始化为适当的值
            MovedToWorldEventArgs target      = new MovedToWorldEventArgs(oldLocation, oldMap, gameEntity);

            Assert.Inconclusive("TODO: 实现用来验证目标的代码");
        }
        public void OnMovedToTest()
        {
            WorldEntityState target     = new WorldEntityState(); // TODO: 初始化为适当的值
            Point3D          location   = new Point3D();          // TODO: 初始化为适当的值
            WorldEntity      gameEntity = null;                   // TODO: 初始化为适当的值

            target.OnMovedTo(location, gameEntity);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
Esempio n. 20
0
        private void AddNewWorldEntity(string name, WorldEntity worldEntity)
        {
            worldEntity.NameChanged += new EventHandler(worldEntity_NameChanged);

            if (Engine.World.AddWorldEntity(name, worldEntity))
            {
                this.lstEntityTypes.Items.Add(name);
            }
        }
Esempio n. 21
0
        public void OnEnterTest()
        {
            BaseMap      owner  = null;                    // TODO: 初始化为适当的值
            MapSpaceNode target = new MapSpaceNode(owner); // TODO: 初始化为适当的值
            WorldEntity  entity = null;                    // TODO: 初始化为适当的值

            target.OnEnter(entity);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
        public void OnUpdatedSerialTest()
        {
            WorldEntityState target     = new WorldEntityState(); // TODO: 初始化为适当的值
            Serial           serial     = new Serial();           // TODO: 初始化为适当的值
            WorldEntity      gameEntity = null;                   // TODO: 初始化为适当的值

            target.OnUpdatedSerial(serial, gameEntity);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
Esempio n. 23
0
        private static MovePlayerClientCommandEntity Map(IMovePlayerClientCommand c, WorldEntity world, PlayerEntity player)
        {
            var result = new MovePlayerClientCommandEntity();

            Fill(result, world, player);
            result.ToX = c.ToX;
            result.ToY = c.ToY;
            return(result);
        }
        public void OnEnteredMapSpaceNodeTest3()
        {
            MapSpaceNodeState target       = new MapSpaceNodeState(); // TODO: 初始化为适当的值
            WorldEntity       worldEntity  = null;                    // TODO: 初始化为适当的值
            MapSpaceNode      mapSpaceNode = null;                    // TODO: 初始化为适当的值

            target.OnEnteredMapSpaceNode(worldEntity, mapSpaceNode);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
Esempio n. 25
0
        public void GameEntityTest()
        {
            WorldEntity          gameEntity = null;                                 // TODO: 初始化为适当的值
            WorldEntityEventArgs target     = new WorldEntityEventArgs(gameEntity); // TODO: 初始化为适当的值
            WorldEntity          actual;

            actual = target.GameEntity;
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Esempio n. 26
0
        public override void Init()
        {
            Content.ContentPath = "Data";
            Content.ContentCachePath = "Cache/";
            WorldScene = new WorldScene(this);

            WorldScene.Camera = new ClientCommon.WalkaroundCamera(this, delegate(float x, float y) { return 0; });

            SkinnedMesh goblin1 = content.Get<SkinnedMesh>("death1.x");

            gob_model_test = new Model { SkinnedMesh = goblin1, Texture = content.Get<Texture>("death1.png"), Effect = content.Get<Effect>("effects.fx"), HasAlpha = true };

            WorldEntity c;

            WorldScene.Add(c = new WorldEntity()
            {
                Model = gob_model_test,
            });

            //c.AnimationController.SetTrackAnimationSet(1, c.AnimationController.GetAnimationSet("cast1"));
            //c.AnimationController.SetTrackAnimationSet(0, c.AnimationController.GetAnimationSet("cast1"));

            //c.AnimationController.EnableTrack(1);
            //c.AnimationController.DisableTrack(1);
            //c.AnimationController.SetTrackWeight(0, 1);
            //c/.AnimationController.SetTrackWeight(1, 1);
            //c.AnimationController.SetTrackPriority(1, TrackPriority.High);
            //c.AnimationController.SetTrackPriority(0, TrackPriority.Low);

            //Console.WriteLine(c.AnimationController.GetTrackDescription(1));

            //c.AnimationList.Add("0death1", gob_model_test.SkinnedMesh.CloneAnimationObject("0death1"));
            //c.AnimationList.Add("attack1", gob_model_test.SkinnedMesh.CloneAnimationObject("attack1"));

            /*
            WorldScene.Add(c = new WorldEntity()
            {
                Model = gob_model_test,
                Translation = new Vector3(3, 3, 10)
            });

            c.AnimationList.Add("0death1", gob_model_test.SkinnedMesh.CloneAnimationObject("0death1"));

            WorldScene.Add(c = new WorldEntity()
            {
                Model = gob_model_test,
                Translation = new Vector3(6, 6, 0)
            });

            WorldScene.Add(c = new WorldEntity()
            {
                Model = gob_model_test,
                Translation = new Vector3(6, 3, 0)
            });
            */
        }
        public void GameEntityTest()
        {
            WorldEntity entity = null;                                                               // TODO: 初始化为适当的值
            BaseMap     map    = null;                                                               // TODO: 初始化为适当的值
            WorldEntityLeavingMapEventArgs target = new WorldEntityLeavingMapEventArgs(entity, map); // TODO: 初始化为适当的值
            WorldEntity actual;

            actual = target.GameEntity;
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Esempio n. 28
0
        public void NewMapSpaceNodeTest()
        {
            MapSpaceNode mapSpaceNode            = null;                                                        // TODO: 初始化为适当的值
            WorldEntity  gameEntity              = null;                                                        // TODO: 初始化为适当的值
            UpdatingMapSpaceNodeEventArgs target = new UpdatingMapSpaceNodeEventArgs(mapSpaceNode, gameEntity); // TODO: 初始化为适当的值
            MapSpaceNode actual;

            actual = target.NewMapSpaceNode;
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Esempio n. 29
0
        public bool AddWorldEntity(string name, WorldEntity worldEntity)
        {
            if (!this.worldEntityMap.ContainsKey(name))
            {
                this.worldEntityMap.Add(name, worldEntity);
                return true;
            }

            return false;
        }
        public void NewAITest()
        {
            IArtificialIntelligence artificialIntelligence = null;                                        // TODO: 初始化为适当的值
            WorldEntity             gameEntity             = null;                                        // TODO: 初始化为适当的值
            UpdatingAIEventArgs     target = new UpdatingAIEventArgs(artificialIntelligence, gameEntity); // TODO: 初始化为适当的值
            IArtificialIntelligence actual;

            actual = target.NewAI;
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Esempio n. 31
0
        public void OldYTest()
        {
            float             y          = 0F;                                   // TODO: 初始化为适当的值
            WorldEntity       gameEntity = null;                                 // TODO: 初始化为适当的值
            UpdatedYEventArgs target     = new UpdatedYEventArgs(y, gameEntity); // TODO: 初始化为适当的值
            float             actual;

            actual = target.OldY;
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Esempio n. 32
0
        public void OnMovedTest3()
        {
            BaseMapState target      = new BaseMapState(); // TODO: 初始化为适当的值
            Point3D      oldLocation = new Point3D();      // TODO: 初始化为适当的值
            WorldEntity  worldEntity = null;               // TODO: 初始化为适当的值
            BaseMap      map         = null;               // TODO: 初始化为适当的值

            target.OnMoved(oldLocation, worldEntity, map);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
        /// <summary>
        ///
        /// </summary>
        internal void OnLeavingMapSpaceNode(WorldEntity worldEntity, MapSpaceNode mapSpaceNode)
        {
            EventHandler <WorldEntityLeaveSpaceNodeEventArgs> tempEventArgs = m_EventWorldEntityLeavingSpaceNode;

            if (tempEventArgs != null)
            {
                WorldEntityLeaveSpaceNodeEventArgs eventArgs = new WorldEntityLeaveSpaceNodeEventArgs(worldEntity, mapSpaceNode);
                tempEventArgs(this, eventArgs);
            }
        }
        public void OldMapTest()
        {
            BaseMap             baseMap    = null;                                         // TODO: 初始化为适当的值
            WorldEntity         gameEntity = null;                                         // TODO: 初始化为适当的值
            UpdatedMapEventArgs target     = new UpdatedMapEventArgs(baseMap, gameEntity); // TODO: 初始化为适当的值
            BaseMap             actual;

            actual = target.OldMap;
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Esempio n. 35
0
        /// <summary>
        /// 
        /// </summary>
        internal bool OnEnteringMap( WorldEntity worldEntity, BaseMap map )
        {
            EventHandler<WorldEntityEnteringMapEventArgs> tempBeforeEventArgs = m_EventWorldEntityEnteringMap;
            if ( tempBeforeEventArgs != null )
            {
                WorldEntityEnteringMapEventArgs eventArgs = new WorldEntityEnteringMapEventArgs( worldEntity, map );
                tempBeforeEventArgs( this, eventArgs );

                return eventArgs.IsCancel;
            }

            return false;
        }
Esempio n. 36
0
 public WorldScene(View view)
     : base(view)
 {
     selectionModel = new Model
     {
         XMesh = view.content.Get<SlimDX.Direct3D9.Mesh>("unitplane.x"),
         Texture = view.content.Get<Texture>("selectioncircle1.png"),
         World = Matrix.Scaling(2, 2, 0) * Matrix.Translation(0, 0, 0.1f),
         HasAlpha = true
     };
     billboardEffect = view.content.Get<Effect>("billboard.fx");
     Root = new WorldEntity { Scene = this };
     Renderer = new Renderer(Device);
 }
Esempio n. 37
0
        public AttackResult ComputeAttack(WorldEntity from, WorldEntity to)
        {
            if (from.Stats.MPCurrent >= 4)
            {
                from.Stats.MPCurrent -= 4;
                if (to != null)
                {
                    to.Stats.HPCurrent += 8;
                    to.Stats.HPCurrent = (to.Stats.HPCurrent % to.Stats.Get(EntityStatsContainer.AT_MAX_HP));
                    return AttackResult.Hit; //TODO: better attack results and info return for player
                }
            }

            return AttackResult.Miss;
        }
Esempio n. 38
0
            /// <summary>
            /// 
            /// </summary>
            /// <param name="eventArgs"></param>
            internal static MoveToEventArgs InvokeMoveTo( Point3D newLocation, WorldEntity entity )
            {
                EventHandler<MoveToEventArgs> tempMoveTo = m_MoveTo;
                if ( tempMoveTo != null )
                {
                    MoveToEventArgs moveToEventArgs = new MoveToEventArgs( newLocation, entity );
                    if ( moveToEventArgs == null )
                        return null;

                    tempMoveTo( entity, moveToEventArgs );

                    return moveToEventArgs;
                }

                return null;
            }
Esempio n. 39
0
        public void RunAI(Map map, WorldEntity me, Player player)
        {
            var combat = Rock.Instance.GetService<CombatOverwatchService>() as CombatOverwatchService;
            var combatScreen = Rock.Screen.Top as CombatScreen;

            var res = combat.Attack(me, player, AttackID.Default);
            if (res == AttackResult.Hit)
            {
                me.CombatMessage = me.Name + "'s attack hits!";
            }
            else if (res == AttackResult.Critical)
            {
                me.CombatMessage = me.Name + "'s attack hits for a critical!";
            }
            else if (res == AttackResult.Miss)
            {
                me.CombatMessage = me.Name + "'s attack misses!";
            }
        }
Esempio n. 40
0
        public AttackResult ComputeAttack(WorldEntity from, WorldEntity to)
        {
            if (null == to)
            {
                return AttackResult.Miss;
            }

            int dodgeMod = to.Stats.Get(EntityStatsContainer.AT_DODGE);
            int hitMod = from.Stats.Get(EntityStatsContainer.AT_HIT);

            bool crit = false;
            Random rndm = new Random();
            int rollToHit = rndm.Next(20) + 1;
            if (rollToHit == 20)
            {
                crit = true;
            }

            rollToHit += hitMod;
            if (rollToHit > 10 + dodgeMod)
            {
                int atk = from.Stats.Get(EntityStatsContainer.AT_ATK);
                int atk_rng = (int)Math.Max(atk * 0.1f, 1); //Minimum 1 damage

                if (crit)
                {
                    atk += atk_rng;
                }
                else
                {
                    atk += rndm.Next(2 * atk_rng) - atk_rng;
                }
                to.TakeDamage(atk, crit);

                return (crit ? AttackResult.Critical : AttackResult.Hit);
            }

            return AttackResult.Miss;
        }
Esempio n. 41
0
        public void RunAI(Map map, WorldEntity me, Player player)
        {
            if (originalPosition.X == -1)
            {
                originalPosition.X = me.MyParty.X;
                originalPosition.Y = me.MyParty.Y;
            }

            Random rndm = new Random();
            if (rndm.Next(12) == 1)
            {
                //try roam
                var roamDir = (MapMovement)rndm.Next(4);
                int r_x = 0;
                int r_y = 0;
                switch (roamDir)
                {
                    case MapMovement.Up:
                        r_y = -1;
                        break;
                    case MapMovement.Down:
                        r_y = 1;
                        break;
                    case MapMovement.Left:
                        r_x = -1;
                        break;
                    case MapMovement.Right:
                        r_x = 1;
                        break;
                }

                if (Math.Sqrt(Math.Pow((me.MyParty.X + r_x) - originalPosition.X, 2) + Math.Pow((me.MyParty.Y + r_y) - originalPosition.Y, 2)) < 2)
                {
                    map.Move(me.MyParty.X, me.MyParty.Y, roamDir);
                }
            }
        }
 /// <summary>
 /// 
 /// </summary>
 internal void OnUpdatedMapSpaceNode( MapSpaceNode mapSpaceNode, WorldEntity gameEntity )
 {
     EventHandler<UpdatedMapSpaceNodeEventArgs> tempAfterEventArgs = m_EventUpdatedMapSpaceNode;
     if ( tempAfterEventArgs != null )
     {
         UpdatedMapSpaceNodeEventArgs eventArgs = new UpdatedMapSpaceNodeEventArgs( mapSpaceNode, gameEntity );
         tempAfterEventArgs( this, eventArgs );
     }
 }
        /// <summary>
        /// 
        /// </summary>
        internal bool OnMovingToWorld( Point3D newLocation, BaseMap newMap, WorldEntity gameEntity )
        {
            EventHandler<MovingToWorldEventArgs> tempBeforeEventArgs = m_EventMovingToWorld;
            if ( tempBeforeEventArgs != null )
            {
                MovingToWorldEventArgs eventArgs = new MovingToWorldEventArgs( newLocation, newMap, gameEntity );
                tempBeforeEventArgs( this, eventArgs );

                return eventArgs.IsCancel;
            }

            return false;
        }
 /// <summary>
 /// 
 /// </summary>
 internal void OnMovedToWorld( Point3D oldLocation, BaseMap oldMap, WorldEntity gameEntity )
 {
     EventHandler<MovedToWorldEventArgs> tempAfterEventArgs = m_EventMovedToWorld;
     if ( tempAfterEventArgs != null )
     {
         MovedToWorldEventArgs eventArgs = new MovedToWorldEventArgs( oldLocation, oldMap, gameEntity );
         tempAfterEventArgs( this, eventArgs );
     }
 }
 /// <summary>
 /// 
 /// </summary>
 internal void OnUpdatedMap( BaseMap map, WorldEntity gameEntity )
 {
     EventHandler<UpdatedMapEventArgs> tempAfterEventArgs = m_EventUpdatedMap;
     if ( tempAfterEventArgs != null )
     {
         UpdatedMapEventArgs eventArgs = new UpdatedMapEventArgs( map, gameEntity );
         tempAfterEventArgs( this, eventArgs );
     }
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="mobile"></param>
 /// <param name="newLocation"></param>
 public MoveToWorldEventArgs( Point3D newLocation, BaseMap newMap, WorldEntity entity )
 {
     m_Entity = entity;
     m_NewMap = newMap;
     m_NewLocation = newLocation;
 }
Esempio n. 47
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="baseItem"></param>
        public void OnEnter( WorldEntity entity )
        {
            if ( m_MapSpaceNodeState != null )
                m_MapSpaceNodeState.OnEnteringMapSpaceNode( entity, this );

            m_Entitys.Add( entity, entity );

            if ( m_MapSpaceNodeState != null )
                m_MapSpaceNodeState.OnEnteredMapSpaceNode( entity, this );
        }
 /// <summary>
 /// 
 /// </summary>
 internal void OnUpdatedLocation( Point3D point3D, WorldEntity gameEntity )
 {
     EventHandler<UpdatedLocationEventArgs> tempAfterEventArgs = m_EventUpdatedLocation;
     if ( tempAfterEventArgs != null )
     {
         UpdatedLocationEventArgs eventArgs = new UpdatedLocationEventArgs( point3D, gameEntity );
         tempAfterEventArgs( this, eventArgs );
     }
 }
 /// <summary>
 /// 
 /// </summary>
 internal void OnUpdatedOrientation( float orientation, WorldEntity gameEntity )
 {
     EventHandler<UpdatedOrientationEventArgs> tempAfterEventArgs = m_EventUpdatedOrientation;
     if ( tempAfterEventArgs != null )
     {
         UpdatedOrientationEventArgs eventArgs = new UpdatedOrientationEventArgs( orientation, gameEntity );
         tempAfterEventArgs( this, eventArgs );
     }
 }
        /// <summary>
        /// 
        /// </summary>
        internal bool OnUpdatingLocation( Point3D point3D, WorldEntity gameEntity )
        {
            EventHandler<UpdatingLocationEventArgs> tempBeforeEventArgs = m_EventUpdatingLocation;
            if ( tempBeforeEventArgs != null )
            {
                UpdatingLocationEventArgs eventArgs = new UpdatingLocationEventArgs( point3D, gameEntity );
                tempBeforeEventArgs( this, eventArgs );

                return eventArgs.IsCancel;
            }

            return false;
        }
 /// <summary>
 /// 
 /// </summary>
 internal void OnDeletedCall( WorldEntity gameEntity )
 {
     EventHandler<WorldEntityEventArgs> tempAfterEventArgs = m_EventDeletedCall;
     if ( tempAfterEventArgs != null )
     {
         WorldEntityEventArgs eventArgs = new WorldEntityEventArgs( gameEntity );
         tempAfterEventArgs( this, eventArgs );
     }
 }
Esempio n. 52
0
 public EditNode(string key, WorldEntity worldEntity, SceneNode sceneNode)
 {
     this.key = key;
     this.worldEntity = worldEntity;
     this.sceneNode = sceneNode;
 }
Esempio n. 53
0
 public SetStartPositionState(WorldView view, int team)
     : base(view)
 {
     view.Scene.ClearSelection();
     startPosition = view.TeamStartPositions[team - 1];
     startPosition.IsVisible = true;
 }
Esempio n. 54
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public UnitMechanics( WorldEntity owner )
 {
     m_owner = owner;
     ResetDefaults();
 }
Esempio n. 55
0
            /// <summary>
            /// 
            /// </summary>
            /// <param name="eventArgs"></param>
            internal static MoveToWorldEventArgs InvokeMoveToWorld( Point3D newLocation, BaseMap newMap, WorldEntity entity )
            {
                EventHandler<MoveToWorldEventArgs> tempMoveToWorld = m_MoveToWorld;
                if ( tempMoveToWorld != null )
                {
                    MoveToWorldEventArgs moveToWorldEventArgs = new MoveToWorldEventArgs( newLocation, newMap, entity );
                    if ( moveToWorldEventArgs == null )
                        return null;

                    tempMoveToWorld( entity, moveToWorldEventArgs );

                    return moveToWorldEventArgs;
                }

                return null;
            }
Esempio n. 56
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="baseItem"></param>
        public void OnLeave( WorldEntity entity )
        {
            if ( m_MapSpaceNodeState != null )
                m_MapSpaceNodeState.OnLeavingMapSpaceNode( entity, this );

            m_Entitys.Remove( entity );

            if ( m_MapSpaceNodeState != null )
                m_MapSpaceNodeState.OnLeavedMapSpaceNode( entity, this );
        }
        /// <summary>
        /// 
        /// </summary>
        internal bool OnMovingTo( Point3D location, WorldEntity gameEntity )
        {
            EventHandler<MovingToCallEventArgs> tempBeforeEventArgs = m_EventMovingToCall;
            if ( tempBeforeEventArgs != null )
            {
                MovingToCallEventArgs eventArgs = new MovingToCallEventArgs( location, gameEntity );
                tempBeforeEventArgs( this, eventArgs );

                return eventArgs.IsCancel;
            }

            return false;
        }
 /// <summary>
 /// 
 /// </summary>
 internal void OnUpdatedAI( IArtificialIntelligence artificialIntelligence, WorldEntity gameEntity )
 {
     EventHandler<UpdatedAIEventArgs> tempAfterEventArgs = m_EventUpdatedAI;
     if ( tempAfterEventArgs != null )
     {
         UpdatedAIEventArgs eventArgs = new UpdatedAIEventArgs( artificialIntelligence, gameEntity );
         tempAfterEventArgs( this, eventArgs );
     }
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="mobile"></param>
 /// <param name="newLocation"></param>
 public MoveToEventArgs( Point3D newLocation, WorldEntity entity )
 {
     m_Entity = entity;
     m_NewLocation = newLocation;
 }
 /// <summary>
 /// 
 /// </summary>
 internal void OnMovedTo( Point3D location, WorldEntity gameEntity )
 {
     EventHandler<MovedToCallEventArgs> tempAfterEventArgs = m_EventMovedToCall;
     if ( tempAfterEventArgs != null )
     {
         MovedToCallEventArgs eventArgs = new MovedToCallEventArgs( location, gameEntity );
         tempAfterEventArgs( this, eventArgs );
     }
 }