Example #1
0
        protected void ClientTriggerEffect(int id)
        {
            Effect effect = DataReader <Effect> .Get(id);

            if (effect == null)
            {
                return;
            }
            EffectMaterial effectMaterial = (!this.effectMessageCache.ContainsKey(id)) ? null : this.effectMessageCache.get_Item(id);
            EffectMessage  effectMessage  = new EffectMessage();

            effectMessage.casterActor = this;
            effectMessage.effectData  = effect;
            if (effect.type2 == 4 || effect.type2 == 3)
            {
                effectMessage.basePoint = this.GetEffectBasePoint((EffectBasePointType)effect.@base, (float)effect.tremble, (effectMaterial != null) ? effectMaterial.skillTargetID : 0L, effect.summonId, effect.coord, effect.orientation);
            }
            else
            {
                effectMessage.basePoint = ((effectMaterial != null) ? effectMaterial.basePoint : null);
            }
            this.TriggerEffect(effect.delay, effectMessage);
            if (effectMessage.basePoint != null && effect.fx != 0)
            {
                CommandCenter.ExecuteCommand(base.get_transform(), new BulletFXCmd
                {
                    fxID  = effect.fx,
                    point = effectMessage.basePoint,
                    useY  = true
                });
            }
        }
Example #2
0
    protected void OnPetUltraSKillEnd(EntityParent pet)
    {
        Debug.LogError("OnPetUltraSKillEnd");
        this.isPetUltraSKill            = true;
        this.petUltraSkillEndPassedTime = 0f;
        this.closeUpTotalTime           = 0f;
        Pet pet2 = DataReader <Pet> .Get(pet.TypeID);

        List <float> camManualSkill = pet2.camManualSkill;
        float        num            = camManualSkill.get_Item(0);
        float        num2           = camManualSkill.get_Item(1);
        float        num3           = camManualSkill.get_Item(2);

        for (int i = 0; i < this.partTimeTotal.Length; i++)
        {
            this.partTimeTotal[i]   = camManualSkill.get_Item(i + 3);
            this.partTimeElapsed[i] = 0f;
        }
        this.PetUltraSKillEndRotationFrom     = Quaternion.LookRotation(base.get_transform().get_forward());
        this.petUltraSkillEndPositionFrom     = base.get_transform().get_position();
        this.petUltraSkillEndRolePositionFrom = this.role.get_position();
        Vector3 vector  = -base.get_transform().get_forward().AssignYZero();
        Vector3 vector2 = vector * num3;
        Vector3 vector3 = new Vector3(0f, num2, 0f);

        Debug.LogError("OnPetUltraSKillEnd=" + pet.Actor.FixTransform.get_position());
        this.petUltraSkillEndPositionTo = pet.Actor.FixTransform.get_position() + vector2 + vector3;
        Vector3 vector4 = pet.Actor.FixTransform.get_position() + new Vector3(0f, num, 0f);

        this.PetUltraSKillEndRotationTo = Quaternion.LookRotation(vector4 - this.petUltraSkillEndPositionTo);
        CommandCenter.ExecuteCommand(pet.Actor.FixTransform, new ChangeAllFXLayerCmd());
        Utils.SetCameraCullingMask(CamerasMgr.CameraMain, 7);
    }
Example #3
0
        public virtual bool AddBuff(int buffID, int time)
        {
            Buff buffData = this.GetBuffByID(buffID);

            if (this.owner.Actor)
            {
                this.buffList.Add(buffID);
                CommandCenter.ExecuteCommand(this.owner.Actor.FixTransform, new PlayBuffFXCmd
                {
                    fxID   = buffData.fx,
                    buffID = buffID,
                    time   = 0,
                    scale  = DataReader <AvatarModel> .Get(this.owner.FixModelID).fxScale
                });
                if (buffData.action != string.Empty)
                {
                    this.owner.Actor.AddStageSuffix(buffData.action);
                    Action value = delegate
                    {
                        this.owner.Actor.RemoveStageSuffix(buffData.action);
                    };
                    if (this.buffEnterAndExitFunc.ContainsKey(buffID))
                    {
                        this.buffEnterAndExitFunc[buffID] = value;
                    }
                    else
                    {
                        this.buffEnterAndExitFunc.Add(buffID, value);
                    }
                }
                return(true);
            }
            return(false);
        }
        public static CommandCenter CreateCommandCenter(float xPos, float yPos, Player owner, int currentAreaID)
        {
            CommandCenter c = new CommandCenter(xPos, yPos, _localIDManager.PopFreeID(), owner, currentAreaID);

            _galaxyRegistrationManager.RegisterObject(c);
            return(c);
        }
Example #5
0
 void Start()
 {
     commandCenter = FindObjectOfType <CommandCenter>();
     enabled       = true;
     // Set the lights to the proper enabled value:
     SetLights();
 }
Example #6
0
        public static void broadcast()
        {
            identifySelf();
            byte[] data;
            object obj;

            while (connection.isConnected)
            {
                data = Util.Integrity.receiveAndConfirmMessageFromStream(connection);
                obj  = Util.Serialization.deserialize(data);
                data = null;
                if (obj is Command)
                {
                    CommandCenter.processCommand(obj as Command);
                }
                Util.Integrity.sendObject(connection, CommandQueue.getCommand());
                Thread.Sleep(10); //necesarry for garbage collector to catch up to my shitty coding
            }
            bool connected = attemptConnection(host, port);

            while (!connected)
            {
                connected = attemptConnection(host, port);
            }
            broadcast();
        }
Example #7
0
 public override void PetLeaveBattleField(BattleAction_PetLeaveField data, bool isServerData)
 {
     if (data.petId != this.owner.ID)
     {
         return;
     }
     if (this.owner.IsDead)
     {
         return;
     }
     if (this.owner.IsClientDominate)
     {
         ExitBattleFieldAnnouncer.Announce(this.owner);
     }
     BattleBlackboard.Instance.SetPetCountDown(this.owner.OwnerListIdx, new KeyValuePair <float, DateTime>(0f, DateTime.get_Now()));
     if (this.owner.Actor)
     {
         this.owner.Actor.EndAnimationResetToIdle();
         if (this.owner.IsFighting)
         {
             FXManager.Instance.PlayFX(96, null, this.owner.Actor.FixTransform.get_position(), this.owner.Actor.FixTransform.get_rotation(), 1f, 1f, 0, false, 0, null, null, 1f, FXClassification.Normal);
         }
     }
     if (!this.owner.IsClientCreate && this.owner.IsClientDrive)
     {
         LocalBattleHandler.Instance.AppClearBuff(this.owner.ID);
     }
     CommandCenter.ExecuteCommand(this.owner.Actor.FixTransform, new RemoveAllFXCmd());
     this.owner.IsFighting = false;
 }
Example #8
0
 public MainWindowModel(MainWindow window)
 {
     commandCenter    = new CommandCenter(this);
     mainWindow       = window;
     CommandInputText = string.Empty;
     MonstersList     = new ObservableCollection <MonsterData>();
 }
    bool Init()
    {
        // make sure we have everything we need before this function ends!
//			if (this.IconLocTarget == null){
//				isFullyInit = false;
//				return isFullyInit;
//			}
        CommandCenter tempCC = this.IconLocTarget.GetComponent <CommandCenter>();

        if (tempCC == null)
        {
            Debug.Log("" + gameObject.name + " No tempCC attached to IconLocTarget");
            isFullyInit = false;
            return(isFullyInit);
        }

        // We're attached to an enemy, now we can processes it
        _myCommandCenter = tempCC;

        FUIWindowToggles testWindow = this.GetComponent <FUIWindowToggles>();

        if (testWindow == null)
        {
            Debug.Log("" + gameObject.name + " No window attached to IconLocTarget");
            isFullyInit = false;
            return(isFullyInit);
        }
        myWindow = testWindow;

        isFullyInit = true;
        return(isFullyInit);
    }
            public void Assigns_a_rover_list_to_CommandInvoker_for_use_in_commands()
            {
                var mockCommandInvoker = new Mock<ICommandInvoker>();

                var commandCenter = new CommandCenter(null, null, mockCommandInvoker.Object, null);

                mockCommandInvoker.Verify(x => x.SetRovers(It.IsAny<IList<IRover>>()), Times.Once());
            }
Example #11
0
            public void Assigns_a_rover_list_to_CommandInvoker_for_use_in_commands()
            {
                var mockCommandInvoker = new Mock <ICommandInvoker>();

                var commandCenter = new CommandCenter(null, null, mockCommandInvoker.Object, null);

                mockCommandInvoker.Verify(x => x.SetRovers(It.IsAny <IList <IRover> >()), Times.Once());
            }
        public void SaveCommands(string worldId, [FromBody] CommandCenter cc)
        {
            var world = rep.FirstOrDefault(q => q.PublicId == Guid.Parse(worldId));

            world.CommandCenter.Probes = cc.Probes;

            rep.Update(world);
        }
 public VpnConnector(JsonSerializerSettings jsonSerializerSettings)
 {
     serializerSettings = jsonSerializerSettings;
     serializerSettings.NullValueHandling = NullValueHandling.Ignore;
     timeoutCounter = 0;
     CommandCenter  = new CommandCenter(this);
     parser         = new MessageParser(this, CommandCenter);
 }
Example #14
0
 public void Setup(string dbName, CommandCenter cCenter, MessageCenter mCenter)
 {
     _dbName = dbName;
     manager.SetDbName(dbName);
     messageCenter = mCenter;
     commandCenter = cCenter;
     commandCenter.OnCommandChanged += new CommandCenter.OnCommandChangedHandler(commandCenter_OnCommandChanged);
 }
Example #15
0
        public void LoadProfile()
        {
            if (isNewProfile) //the profile will be created with the 'default' settings
            {
                isNewProfile = false;

                DirectoryInfo defaultDir = new DirectoryInfo(profilesFolder + "\\" + defaultProfileFolder);

                foreach (FileInfo defaultFile in defaultDir.GetFiles())
                {
                    if (Directory.Exists(profilesFolder + "\\" + currentProfileFolder) == false)
                    {
                        Directory.CreateDirectory(profilesFolder + "\\" + currentProfileFolder);
                    }
                    File.Copy(profilesFolder + "\\" + defaultProfileFolder + "\\" + defaultFile.Name, profilesFolder + "\\" + currentProfileFolder + "\\" + defaultFile.Name);
                }
            }
            //at this point the profile already exists (weather it has just been created or it already existed)
            //and it will be loaded

            CommandCenterEventArgs optionsPanelSettings = xmlData.LoadSettings(profilesFolder + "\\" + currentProfileFolder);

            CommandCenter.SetGameOptions(optionsPanelSettings);
            try
            {
                CommandCenter.OnSaveOptions -= new EventHandler <CommandCenterEventArgs>(CommandCenter_OnSaveOptions);
            }
            catch (Exception) { }

            CommandCenter.OnSaveOptions += new EventHandler <CommandCenterEventArgs>(CommandCenter_OnSaveOptions);
            ResetAutosaveTimer(CommandCenter.GetCurrentSettings.AutosaveTimeValue);
            //sound
            float volume = (float)optionsPanelSettings.VolumeValue;

            if (volume > 0)
            {
                volume /= 10; //maximum will be 0.9f
            }
            SoundManager.GeneralSoundVolume = volume;
            if (optionsPanelSettings.SoundState == "On")
            {
                SoundManager.SoundsOn = true;
            }
            else
            {
                SoundManager.SoundsOn = false;
            }

            CommandCenterEventArgs timeGatePanelLevels = xmlData.LoadTimeGateUpgradeLevels(profilesFolder + "\\" + currentProfileFolder);

            CommandCenter.SetTimeGateLevels(timeGatePanelLevels);

            List <CommandCenterEventArgs> zonesParameters = xmlData.LoadZonesParameters(profilesFolder + "\\" + currentProfileFolder);

            CommandCenter.SetZoneParameters(zonesParameters);

            CommandCenter.SetCurrentUser(currentProfileFolder);
        }
Example #16
0
        /// <summary>
        /// Initializes a player of the Terran race.
        /// </summary>
        /// <param name="player">The player to be initialized.</param>
        private void TerranInitializer(Player player)
        {
            if (player == null)
            {
                throw new ArgumentNullException("player");
            }

            /// Add a Terran Command Center to the position of the start location.
            Scenario scenario = player.StartLocation.Scenario;
            //Starport commandCenter = new Starport();
            CommandCenter commandCenter = new CommandCenter();

            scenario.AddElementToScenario(commandCenter);
            player.AddBuilding(commandCenter);
            commandCenter.AttachToMap(scenario.Map.GetQuadTile(player.QuadraticStartPosition.Location));

            /// TEST: Add a Terran Comsat Station
            //ComsatStation comsatStation = new ComsatStation();
            //scenario.AddElementToScenario(comsatStation);
            //player.AddAddon(comsatStation);
            //comsatStation.AttachToMap(scenario.Map.GetQuadTile(player.QuadraticStartPosition.Location + new RCIntVector(4, 1)));
            /// TEST END

            /// Find place for the given number of SCVs using an EntityNeighbourhoodIterator.
            EntityNeighbourhoodIterator cellIterator   = new EntityNeighbourhoodIterator(commandCenter);
            IEnumerator <ICell>         cellEnumerator = cellIterator.GetEnumerator();

            for (int scvCount = 0; scvCount < NUM_OF_SCVS; scvCount++)
            {
                /// Create the next SCV
                //Wraith scv = new Wraith();
                SCV scv = new SCV();
                //Unit scv = scvCount % 2 == 0 ? (Unit)new SCV() : (Unit)new Marine();
                scenario.AddElementToScenario(scv);
                player.AddUnit(scv);

                /// Search a place for the new SCV on the map.
                bool scvPlacedSuccessfully = false;
                while (cellEnumerator.MoveNext())
                {
                    if (scv.AttachToMap(cellEnumerator.Current.MapCoords))
                    {
                        scvPlacedSuccessfully = true;
                        break;
                    }
                }

                /// Remove the SCV and stop initializing if there is no more place on the map.
                if (!scvPlacedSuccessfully)
                {
                    player.RemoveUnit(scv);
                    scenario.RemoveElementFromScenario(scv);
                    scv.Dispose();
                    break;
                }
            }
        }
            public void Assigns_LandingSurface_to_CommandInvoker_for_use_in_commands()
            {
                var mockLandingSurface = new Mock<ILandingSurface>();
                var mockCommandInvoker = new Mock<ICommandInvoker>();

                var commandCenter = new CommandCenter(mockLandingSurface.Object, null, mockCommandInvoker.Object, null);

                mockCommandInvoker.Verify(x => x.SetLandingSurface(mockLandingSurface.Object), Times.Once());
            }
Example #18
0
 public bool AskForCaptain(CommandCenter c, FlankingRoute[] flankingRoutes, Transform[] suppressingPositions)
 {
     if (baseScript.CanStartCommand())
     {
         DistributeOrders(flankingRoutes, suppressingPositions);
         return(true);
     }
     return(false);
 }
Example #19
0
    protected void SetPlayerActor(ActorPlayer actorPlayer, Action logicCallback)
    {
        AvatarModel avatarModel = DataReader <AvatarModel> .Get(this.FixModelID);

        base.Actor            = actorPlayer;
        actorPlayer.theEntity = this;
        base.Actor.FixGameObject.set_name(base.ID.ToString());
        base.Actor.FixGameObject.SetActive(true);
        base.Actor.InitActionPriorityTable();
        base.Actor.CanAnimatorApplyMotion = false;
        base.Actor.DataLayerState         = ((avatarModel.collideOff <= 0) ? 0 : 1);
        base.Actor.DefaultModelHeight     = avatarModel.defaultModelHeight;
        base.Actor.ModelHeight            = avatarModel.defaultModelHeight;
        base.Actor.IsLockModelDir         = (avatarModel.lockDirection == 1);
        base.Actor.RotateSpeed            = avatarModel.RotateSpeed;
        base.Actor.RotateInterval         = (float)avatarModel.rotateInterval;
        base.Actor.StartRotateAngle       = (float)avatarModel.startAngle;
        base.Actor.FinishRotateAngle      = (float)avatarModel.finishAngle;
        base.Actor.FloatRate = avatarModel.floatProba;
        ShadowController.ShowShadow(base.ID, base.Actor, false, this.FixModelID);
        ShaderEffectUtils.InitShaderRenderers(base.Actor.FixTransform, this.shaderRenderers, ref this.shadowRenderer, ref this.shadowSlicePlane);
        ShaderEffectUtils.InitHitEffects(this.shaderRenderers, this.hitControls);
        ShaderEffectUtils.InitTransparencys(this.shaderRenderers, this.alphaControls);
        ShaderEffectUtils.SetFadeRightNow(this.alphaControls, false);
        ShaderEffectUtils.SetOutlineStatus(base.Actor.FixTransform, LuminousOutline.Status.Normal);
        if (avatarModel.curve == 1)
        {
            ShaderEffectUtils.SetMeshRenderToLayerFXDistortion(base.Actor.FixTransform);
        }
        this.InitBillboard((float)avatarModel.height_HP, avatarModel.bloodBar);
        WaveBloodManager.Instance.AddWaveBloodControl(base.Actor.FixTransform, (float)avatarModel.height_Damage, base.ID);
        if (this.IsInBattle)
        {
            if (this.IsDead)
            {
                CommandCenter.ExecuteCommand(base.Actor.FixTransform, new PlayActionCmd
                {
                    actName    = "die",
                    jumpToPlay = true,
                    percent    = 1f
                });
            }
            else
            {
                base.Actor.CastAction("born", true, 1f, 0, 0, string.Empty);
            }
        }
        else
        {
            base.Actor.CastAction("idle", true, 1f, 0, 0, string.Empty);
        }
        if (logicCallback != null)
        {
            logicCallback.Invoke();
        }
        this.InitActorState();
    }
Example #20
0
            public void Assigns_LandingSurface_to_CommandInvoker_for_use_in_commands()
            {
                var mockLandingSurface = new Mock <ILandingSurface>();
                var mockCommandInvoker = new Mock <ICommandInvoker>();

                var commandCenter = new CommandCenter(mockLandingSurface.Object, null, mockCommandInvoker.Object, null);

                mockCommandInvoker.Verify(x => x.SetLandingSurface(mockLandingSurface.Object), Times.Once());
            }
Example #21
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (_local == null)
        {
            _local = ToyBox.GetPandora().CommandCenter_01;
        }


        PullToCenter(_local.gameObject, _local.GetComponent <Rigidbody>().mass);
    }
        public CommandCenter Build(string name)
        {
            CommandCenter cc = new CommandCenter();

            cc.cost        = null;
            cc.name        = name;
            cc.isDestroyed = false;
            cc.level       = 1;
            return(cc);
        }
Example #23
0
 public void PlayHitFX(Transform caster, int fxID, float scale, List <int> offsets)
 {
     CommandCenter.ExecuteCommand(base.get_transform(), new HitFXCmd
     {
         fxID    = fxID,
         caster  = caster,
         scale   = scale,
         offsets = offsets
     });
 }
Example #24
0
        public MainWindowModel(MainWindow window)
        {
            saveManager      = new SaveManager(AppConfig.DefaultSaveLocation, AppConfig.BackUpLocation, AppConfig.FileToWatch);
            saveFolderText   = AppConfig.DefaultSaveLocation;
            backupFolderText = AppConfig.BackUpLocation;
            commandCenter    = new CommandCenter(saveManager);

            mainWindow       = window;
            CommandInputText = string.Empty;
        }
Example #25
0
            public void Returns_injected_LandingSurface()
            {
                var expectedLandingSurface = new Mock <ILandingSurface>();
                var mockCommandinvoker     = new Mock <ICommandInvoker>();
                var commandCenter          = new CommandCenter(expectedLandingSurface.Object, null, mockCommandinvoker.Object, null);

                var landingSurface = commandCenter.GetLandingSurface();

                Assert.AreEqual(expectedLandingSurface.Object, landingSurface);
            }
    }    //All Collisions ON Stay Check

    protected void ProcessBotandCCTouchDamage(Collision col)
    {
        //We must make sure we have a self... if not.. well... return!
        if (self == null)
        {
            return;
        }

        // when was the last time we did damage?  able to do damage every two seconds

        if (!canTouchDamage)
        {
            return;
        }

        //Check if we collide with a CommandCenter.
        if (col.gameObject.CompareTag("CommandCenter") && (!self.IsDestroyed()))         //&& selfAsEnemy.AttackCommandCenters))
        {
            CommandCenter c = col.gameObject.GetComponent <CommandCenter>();

            c.Damage(TouchDamageToCC);
            self.Damage(touchDamageToSelf);                      // this may not kill me
            // we do our damage, set can do damage off and hit the clock
            canTouchDamage   = false;
            touchDamageClock = Time.time;

            //Send the detonation message to the GOT
            GameObjectTracker.GetGOT().TargetDetonated();
        }
        //Check if we collide with a Player Bot
        //TODO:CRashing here.
        if (col.gameObject.CompareTag("Bot") && (!self.IsDestroyed()))         //&& selfAsEnemy.AttackBots))
        {
            Bot b = col.gameObject.GetComponent <Bot>();

            //Dont blow up if shield is active.
            if (b.IsShieldActive())
            {
                return;
            }

            b.Damage(TouchDamageToBot);
            self.Damage(touchDamageToSelf);              // this may not kill me

            //Send the detonation message to the GOT
            GameObjectTracker.GetGOT().TargetDetonated();
            // we do our damage, set can do damage off and hit the clock
            canTouchDamage   = false;
            touchDamageClock = Time.time;
        }



        // end processing bot and cc
    }
Example #27
0
        static void Main(string[] args)
        {
            var commandCenter = new CommandCenter();
            WriteMessageToConsole(commandCenter.SendCommand("5 5"));
            WriteMessageToConsole(commandCenter.SendCommand("1 2 N"));
            WriteMessageToConsole(commandCenter.SendCommand("LMLMLMLMM"));
            WriteMessageToConsole(commandCenter.SendCommand("3 3 E"));
            WriteMessageToConsole(commandCenter.SendCommand("MMRMMRMRRM"));

            System.Console.ReadKey();
        }
Example #28
0
        public void SetUpEnvironmentCreatesLocationField()
        {
            CommandCenter center = new CommandCenter();

            center.fieldParams = "5 3";

            center.SetupLocationField();

            Assert.NotNull(center.martianField);
            Assert.Equal(5, center.martianField.width);
        }
        static void Main(string[] args)
        {
            CommandCenter commandCenter = new CommandCenter();

            commandCenter.GetPlayerManager().Welcome();
            commandCenter.GetPlayerManager().LoginOrSignUp();

            while (true)
            {
                commandCenter.EnterCommand();
            }
        }
Example #30
0
        public void PrintOperationReportBuildsCorrectOutput()
        {
            CommandCenter center = new CommandCenter();

            center.operationResults = new List <string> {
                "1 1 E", "3 3 N LOST", "2 3 S"
            };

            center.PrintOperationReport();

            Assert.Equal("1 1 E\r\n3 3 N LOST\r\n2 3 S\r\n", center.operationReport);
        }
            public void Invokes_ReportComposer_CompileReports()
            {
                const string expectedReport = "any";
                var mockReportComposer = new Mock<IReportComposer>();
                var mockCommandInvoker = new Mock<ICommandInvoker>();
                mockReportComposer.Setup(x => x.CompileReports(It.IsAny<List<IRover>>()))
                    .Returns(expectedReport);

                var commandCenter = new CommandCenter(null, null, mockCommandInvoker.Object, mockReportComposer.Object);
                var report = commandCenter.GetCombinedRoverReport();
                Assert.AreEqual(expectedReport, report);
            }
//	// Update is called once per frame
//	void FixedUpdate () {
//
//		HandleBallGathering();
//
//	}


//	void HandleBallGathering()
//	{
//		//We cant and wont gather balls if we dont have a cannon!
//
//
//		//Handle the gathering of balls update.
//		if(gathering)
//		{
//			Active = true;
//
//			foreach(Ball b in BallView)
//			{
//				if(!b.IsActive())
//				PullToCenter(b.gameObject);
//			}
//
//			if(BallCount >= commandedgather)
//			{
//				gathering = false;
//			}
//		}
//		else{
//			Active = false;
//		}
//	}
//
//	public void GatherBalls(int count)
//	{
//		//We set the commanded gather
//		commandedgather = count;
//
//		//We turn on the gathering mode if this function is called and we have less balls than commanded to gather
//		if(BallCount < count)
//		{
//			gathering = true;
//		}
//
//	}
//
    void OnTriggerStay(Collider col)
    {
        //print("SmartBeam Collision!");

        //Check if we collide with balls.
        if (col.gameObject.CompareTag("Ball"))
        {
            Ball b = col.gameObject.GetComponent <Ball>();

            if (b.IsActive() || BallView.Contains(b))
            {
                return;
            }

            BallView.Add(b);
        }

        if (col.gameObject.CompareTag("CommandCenter"))
        {
            CommandCenter c = col.gameObject.GetComponent <CommandCenter>();

            if (TargetView.Contains(c))
            {
                return;
            }

            TargetView.Add(c);
        }

        ///** Franks add
        ///
        if (col.gameObject.CompareTag("Cannon"))
        {
            Cannon c = col.gameObject.GetComponent <Cannon>();
            if (c.InUse || CannonView.Contains(c))
            {
                return;
            }

            CannonView.Add(c);
        }
        ///


        if (col.gameObject.CompareTag("Bot"))
        {
            if (!BotView)
            {
                BotView = col.gameObject.GetComponent <Bot>();
            }
        }
    }
Example #33
0
        /// <summary>
        /// Type=1001 酷Q启动<para/>
        /// 处理 酷Q 的启动事件回调
        /// </summary>
        /// <param name="sender">事件的触发对象</param>
        /// <param name="e">事件的附加参数</param>
        public void CqStartup(object sender, EventArgs e)
        {
            // 本子程序会在酷Q【主线程】中被调用。
            // 无论本应用是否被启用,本函数都会在酷Q启动后执行一次,请在这里执行插件初始化代码。
            // 请务必尽快返回本子程序,否则会卡住其他插件以及主程序的加载。

            Common.AppDirectory = Common.CqApi.GetAppDirectory();               // 获取应用数据目录 (无需存储数据时, 请将此行注释)
            CommandCenter.ReloadManagers();
            DataManager.Init(Common.AppDirectory);

            // 返回如:D:\CoolQ\app\com.example.demo\
            // 应用的所有数据、配置【必须】存放于此目录,避免给用户带来困扰。
        }
            public void Parses_command_string_and_invokes_all_commands()
            {
                var expectedInvocationList = new ICommand[]{};
                var mockCommandParser = new Mock<ICommandParser>();
                mockCommandParser.Setup(x => x.Parse(null)).Returns(expectedInvocationList);

                var mockCommandInvoker = new Mock<ICommandInvoker>();

                var commandCenter = new CommandCenter(null, mockCommandParser.Object, mockCommandInvoker.Object, null);
                commandCenter.Execute(null);

                mockCommandInvoker.Verify(x => x.Assign(expectedInvocationList), Times.Once());
                mockCommandInvoker.Verify(x => x.InvokeAll(), Times.Once());
            }
        void CreateAndShowCommandCenter()
        {
            CameraFreeze();
            commandCenter = new CommandCenter(this.Game);
            commandCenter.StackOrder = 5;
            root.AddChild(commandCenter);

            commandCenter.OnEnterZone += new EventHandler<CommandCenterEventArgs>(commandCenter_OnEnterZone);
            commandCenter.OnSaveGame += new EventHandler<CommandCenterEventArgs>(commandCenter_OnSaveGame);
            commandCenter.OnLogOut += new EventHandler(commandCenter_OnLogOut);
            commandCenter.OnExitGame += new EventHandler(commandCenter_OnExitGame);
            commandCenter.Show(); //the MAP button will initially be pressed, this way

            //loads the selected profile (if the profile already exists)
            //or creates and then loades the input profile (if it is a new profile)
            ProfilesManager.LoadProfile();

            CommandCenterLoaded = true;
        }
Example #36
0
	// Use this for initialization
	void Start () 
	{
		test = new CommandCenter();
		test.Main();
	}
Example #37
0
 public Launcher()
 {
     _launcher = new CommandCenter(new ThunderMissileLauncher());
 }
	/// <summary>
	/// Get a reference to the command center.
	/// </summary>
	private void Awake()
	{
		m_commandCenter = GetComponent<CommandCenter>();
	}
            public void Returns_injected_LandingSurface()
            {
                var expectedLandingSurface = new Mock<ILandingSurface>();
                var mockCommandinvoker = new Mock<ICommandInvoker>();
                var commandCenter = new CommandCenter(expectedLandingSurface.Object, null, mockCommandinvoker.Object, null);

                var landingSurface = commandCenter.GetLandingSurface();

                Assert.AreEqual(expectedLandingSurface.Object, landingSurface);
            }