Exemple #1
0
 // Token: 0x0600073A RID: 1850 RVA: 0x0002A250 File Offset: 0x00028450
 public void RemoveCamera(CCTV c)
 {
     if (c.isFixedCamera)
     {
         return;
     }
     if (this.cctvCameras.Contains(c))
     {
         this.cctvCameras.Remove(c);
     }
     if (this.cctvCameras.Count == 0)
     {
         if (this.screen)
         {
             this.screen.material.color = Color.black;
             this.screen.material.SetTexture("_EmissionMap", this.texture);
         }
         if (this.screenText)
         {
             this.screenText.text = "00/00";
         }
     }
     this.RemoveDeactivatedCameras();
     this.NextCamera();
 }
Exemple #2
0
    IEnumerator CameraAlarmCoroutine(Vector3 _target, CCTV _callingCamera)
    {
        float distanceToTarget = 0.0f;

        hasReachedTarget = false;
        mActiveState     = M_CHECKING_CAMERA_CALL;

        mAgent.destination = _target;
        mAgent.speed       = 7;

        //Solange nicht das Ziel erreicht wurde
        while (!hasReachedTarget)
        {
            distanceToTarget = (_target - transform.position).magnitude;
            //Prüfe, ob aktuelle Distanz zum Punkt kleiner ist
            //als die maximale Wegpunktsentfernung
            if (distanceToTarget < mTargetMaxChangeValue)
            {
                //Wenn das so ist, dann ist das Ziel erreicht
                hasReachedTarget = true;
            }
            yield return(new WaitForEndOfFrame());
        }
        //Warte 5 Sekunden
        yield return(new WaitForSeconds(mWaypointWaitingTime));

        //Gehe wieder zurück auf Patroullie
        hasReachedTarget = false;
        distanceToTarget = 0.0f;
        mActiveState     = M_PATROULLING;
        //Setze Kamera zurück
        _callingCamera.ResetCall();
        _callingCamera.mAlarmed = false;
        yield return(null);
    }
Exemple #3
0
    private void VRGrabOrPlaceCameraNetworked(int viewID, bool isPlaced)
    {
        if (PhotonView.Find(viewID) == null)
        {
            return;
        }
        CCTV component = PhotonView.Find(viewID).GetComponent <CCTV>();

        if (isPlaced)
        {
            if (this.view.isMine)
            {
                component.TurnOn();
            }
        }
        else if (this.view.isMine)
        {
            component.TurnOff();
        }
        for (int i = 0; i < component.rends.Length; i++)
        {
            component.rends[i].enabled = !isPlaced;
        }
        if (!this.view.isMine)
        {
            for (int j = 0; j < this.headCameraModels.Length; j++)
            {
                this.headCameraModels[j].SetActive(isPlaced);
            }
        }
        this.isEquipped = isPlaced;
        this.headCamera = (isPlaced ? component : null);
    }
Exemple #4
0
 // Token: 0x06000C1C RID: 3100 RVA: 0x0004C0B9 File Offset: 0x0004A2B9
 public void GrabCamera(CCTV headCam)
 {
     this.view.RPC("EquippedCamera", PhotonTargets.All, new object[]
     {
         headCam.GetComponent <PhotonView>().viewID
     });
 }
Exemple #5
0
 // Token: 0x06000739 RID: 1849 RVA: 0x0002A1F8 File Offset: 0x000283F8
 public void AddCamera(CCTV c)
 {
     if (!this.cctvCameras.Contains(c))
     {
         this.cctvCameras.Add(c);
     }
     if (this.screen)
     {
         this.screen.material.color = Color.white;
     }
     this.RemoveDeactivatedCameras();
     this.NextCamera();
 }
Exemple #6
0
 /// <summary>
 /// CCTV 장치 그래프를 위한 쓰레드
 /// </summary>
 private void ThreadCCTV()
 {
     while (mg.CloseWindows == 0)
     {
         int errorCount = 0;
         lock (obj)
         {
             foreach (Camera c in mg.GetCameraList())
             {
                 if (c.STATUS == Camera.ERROR)
                 {
                     errorCount++;
                 }
             }
         }
         CCTV.SetVaule(errorCount, mg.CountCamera());
         Thread.Sleep(1000);
     }
 }
Exemple #7
0
    private void EquippedCamera(int viewID)
    {
        CCTV component = PhotonView.Find(viewID).GetComponent <CCTV>();

        this.isEquipped = true;
        this.headCamera = component;
        this.headCamera.transform.SetParent(this.headDropZone.transform);
        this.headCamera.transform.localPosition = Vector3.zero;
        this.headCamera.transform.localRotation = Quaternion.identity;
        for (int i = 0; i < GameController.instance.playersData.Count; i++)
        {
            if (GameController.instance.playersData[i].actorID == this.view.ownerId)
            {
                this.headCamera.cam.transform.SetParent(this.characterHeadCamSpots[GameController.instance.playersData[i].player.modelID]);
                this.headCamera.cam.transform.localPosition = Vector3.zero;
                this.headCamera.cam.transform.localRotation = Quaternion.identity;
                if (this.view.isMine)
                {
                    this.headCamera.cam.transform.SetParent(this.headCameraModels[GameController.instance.playersData[i].player.modelID].transform.parent);
                }
            }
        }
        this.headCamera.GetComponent <Collider>().enabled = false;
        if (this.view.isMine)
        {
            this.headCamera.TurnOn();
        }
        for (int j = 0; j < this.headCamera.rends.Length; j++)
        {
            this.headCamera.rends[j].enabled = false;
        }
        if (!this.view.isMine)
        {
            for (int k = 0; k < this.headCameraModels.Length; k++)
            {
                this.headCameraModels[k].SetActive(true);
            }
        }
    }
Exemple #8
0
    }                                                                                                                                        // 0x00000001814E9920-0x00000001814E9EB0

    public void u0927u0922u091Eu091Fu0929u091Eu091Eu0928u091Eu0926u091C(CCTV u091Cu091Fu0922u0927u091Bu091Bu0922u091Eu091Au091Au0928)
    {
    }                                                                                                                                        // 0x00000001814EF140-0x00000001814EF240
Exemple #9
0
    }                                                                             // 0x00000001814E7E70-0x00000001814E7E80

    public void u0924u091Au0928u0921u0924u091Bu0921u0929u091Au0928u091B(CCTV u091Cu091Fu0922u0927u091Bu091Bu0922u091Eu091Au091Au0928)
    {
    }                                                                                                                                        // 0x00000001814ED5E0-0x00000001814ED6E0
Exemple #10
0
    }                                                                             // 0x00000001814EA7F0-0x00000001814EA950

    public void AddCamera(CCTV u091Cu091Fu0922u0927u091Bu091Bu0922u091Eu091Au091Au0928)
    {
    }                                                                                          // 0x00000001814E6AB0-0x00000001814E6BB0
Exemple #11
0
    }                                                                             // 0x00000001814EC410-0x00000001814EC590

    public void u091Fu0926u0928u091Eu0928u091Bu091Au0923u0928u091Cu091F(CCTV u091Cu091Fu0922u0927u091Bu091Bu0922u091Eu091Au091Au0928)
    {
    }                                                                                                                                        // 0x00000001814EB4E0-0x00000001814EB690
Exemple #12
0
    }                                                                             // 0x00000001814EB8F0-0x00000001814EBAA0

    public void u0929u091Eu0929u0925u0925u0929u091Bu091Fu0925u0927u0922(CCTV u091Cu091Fu0922u0927u091Bu091Bu0922u091Eu091Au091Au0928)
    {
    }                                                                                                                                        // 0x00000001814EFE20-0x00000001814EFFD0
Exemple #13
0
    }                           // 0x00000001814E7450-0x00000001814E7570

    public void u091Bu0920u0923u0928u0927u0922u0925u091Cu091Cu091Bu0929(CCTV u091Cu091Fu0922u0927u091Bu091Bu0922u091Eu091Au091Au0928)
    {
    }                                                                                                                                        // 0x00000001814E8650-0x00000001814E8750
    }                                // 0x00000001819A9AE0-0x00000001819A9AF0

    // Methods
    public void u0927u0924u0922u091Bu0921u091Cu091Cu091Bu091Du091Bu091D(CCTV u0920u091Cu0921u0926u0920u091Cu0923u0929u0921u0927u091F)
    {
    }                                                                                                                                        // 0x00000001819A7E70-0x00000001819A7F80
    }                                                                                                                                        // 0x00000001819A90F0-0x00000001819A9200

    public void u0929u0926u0925u0927u0927u0928u0928u0923u091Eu0920u091F(CCTV u0920u091Cu0921u0926u0920u091Cu0923u0929u0921u0927u091F)
    {
    }                                                                                                                                        // 0x00000001819A9200-0x00000001819A9310
Exemple #16
0
    }                                      // 0x00000001814E6AA0-0x00000001814E6AB0

    public void u0927u0922u091Au0928u0922u0925u091Bu0920u0924u0928u0929(CCTV u091Cu091Fu0922u0927u091Bu091Bu0922u091Eu091Au091Au0928)
    {
    }                                                                                                                                        // 0x00000001814EF040-0x00000001814EF140
    }                                                                                                                                                                                                      // 0x000000018199F310-0x000000018199F520

    public void u0923u091Du0927u0920u0924u0922u0927u091Eu0922u0924u091C(CCTV u0920u091Cu0921u0926u0920u091Cu0923u0929u0921u0927u091F)
    {
    }                                                                                                                                        // 0x00000001819A1400-0x00000001819A1510
Exemple #18
0
    }                                                                             // 0x00000001814E6AA0-0x00000001814E6AB0

    public void u0921u0922u091Fu0928u0924u0920u0925u091Du091Bu0925u0927(CCTV u091Cu091Fu0922u0927u091Bu091Bu0922u091Eu091Au091Au0928)
    {
    }                                                                                                                                        // 0x00000001814ECAD0-0x00000001814ECDC0
    }                                                                                                                                        // 0x00000001819A7E70-0x00000001819A7F80

    public void u0926u0927u0929u091Au0925u0927u0921u0929u091Fu0923u0923(CCTV u0920u091Cu0921u0926u0920u091Cu0923u0929u0921u0927u091F)
    {
    }                                                                                                                                        // 0x00000001819A6EF0-0x00000001819A7000
Exemple #20
0
    }                                                                             // 0x00000001814EAD60-0x00000001814EAE20

    public void u0920u0927u0922u0920u0921u0928u0922u0921u091Cu091Fu091E(CCTV u091Cu091Fu0922u0927u091Bu091Bu0922u091Eu091Au091Au0928)
    {
    }                                                                                                                                        // 0x00000001814EBFE0-0x00000001814EC0E0
    }                                                                                                                                        // 0x00000001819A1510-0x00000001819A1B40

    public void GrabCamera(CCTV u0920u091Cu0921u0926u0920u091Cu0923u0929u0921u0927u091F)
    {
    }                                                                                           // 0x000000018199A970-0x000000018199AA80
Exemple #22
0
    }                                                                             // 0x00000001814EA2D0-0x00000001814EA460

    public void u0926u0926u0929u091Eu0924u0929u0922u091Bu0928u091Au0921(CCTV u091Cu091Fu0922u0927u091Bu091Bu0922u091Eu091Au091Au0928)
    {
    }                                                                                                                                        // 0x00000001814EE480-0x00000001814EE630
Exemple #23
0
        /// <summary>
        /// Loads a level from filename.
        /// </summary>
        /// <param name="resource">The level file name</param>
        /// <returns>Level</returns>
        public static Level LoadLevel(string resource)
        {
            var level = new Level();

            // Run in task because TmxMap needs IO and we can only do that in tasks
            Task.Run(() =>
            {
                // Load data
                var map      = new TmxMap(Path.Combine("Content/Levels", resource + ".tmx"));
                level.Name   = resource;
                level.Width  = map.Width;
                level.Height = map.Height;

                // Get tileset data
                var tileset      = map.Tilesets[0];
                level.TileHeight = tileset.TileHeight;
                level.TileWidth  = tileset.TileWidth;

                // Build dictionary with tile indexes and tile objects
                var tilesetDict = new Dictionary <int, Tile>();
                tilesetDict.Add(0, null);                       // 0 means no tile

                // Load texture
                var tilesetTexture = MonoGearGame.GetResource <Texture2D>(Path.Combine("Levels\\Tilesets", Path.GetFileNameWithoutExtension(tileset.Image.Source)));

                // Create tile objects from tileset data and texture
                int rows  = (int)tileset.TileCount / (int)tileset.Columns;
                bool done = false;
                for (int x = 0; x < tileset.Columns && !done; x++)
                {
                    for (int y = 0; y < rows; y++)
                    {
                        // Check if we are finished with the tiles
                        if (x + y * tileset.Columns > tileset.TileCount)
                        {
                            done = true;
                            break;
                        }

                        // Create new tile
                        Tile tile               = new Tile(tilesetTexture);
                        tile.textureRect.X      = x * tileset.TileWidth;
                        tile.textureRect.Y      = y * tileset.TileHeight;
                        tile.textureRect.Width  = tileset.TileWidth;
                        tile.textureRect.Height = tileset.TileHeight;

                        // Tile index stored for debugging
                        int index      = x + y * (int)tileset.Columns;
                        tile.tilesetId = index;

                        // Load custom tile properties
                        TmxTilesetTile tileData;
                        if (tileset.Tiles.TryGetValue(index, out tileData))
                        {
                            Debug.WriteLine("Loading custom properties for tile " + index);

                            // Load solid
                            string solid;
                            if (tileData.Properties.TryGetValue("solid", out solid))
                            {
                                if (solid == "true")
                                {
                                    tile.Walkable = false;
                                }
                                else
                                {
                                    Debug.WriteLine("Tile is not solid but has the property?");
                                }
                            }

                            // Tile walk sound
                            string sound;
                            if (tileData.Properties.TryGetValue("sound", out sound))
                            {
                                Tile.TileSound soundEnum;
                                if (Enum.TryParse(sound, out soundEnum))
                                {
                                    tile.Sound = soundEnum;
                                }
                                else
                                {
                                    Debug.WriteLine("Unknown TileSound value " + sound);
                                }
                            }
                        }

                        // Add tile to dictionary for later use
                        tilesetDict.Add(tileset.FirstGid + index, tile);
                    }
                }

                // Create combined layer tiles
                level.combinedLayer.tiles = new Tile[map.Width * map.Height];

                // Layers get stored bottom to top, we need top to bottom
                var reversedLayers = map.Layers.Reverse();
                foreach (var layer in reversedLayers)
                {
                    Debug.WriteLine("Loading layer: " + layer.Name);

                    // Add layer
                    var levelLayer   = new LevelLayer();
                    levelLayer.tiles = new Tile[map.Width * map.Height];

                    for (int tileIndex = 0; tileIndex < map.Width * map.Height; tileIndex++)
                    {
                        levelLayer.tiles[tileIndex] = tilesetDict[layer.Tiles[tileIndex].Gid];

                        // Update top layer if:
                        // level layer has a tile AND
                        // top layer is walkable but level is not OR
                        // top layer has no tile
                        if (levelLayer.tiles[tileIndex] != null &&
                            (level.combinedLayer.tiles[tileIndex] == null ||
                             (level.combinedLayer.tiles[tileIndex].Walkable && levelLayer.tiles[tileIndex].Walkable == false)))
                        {
                            level.combinedLayer.tiles[tileIndex] = levelLayer.tiles[tileIndex];
                        }
                    }

                    // Add layer to level
                    level.tileLayers.Add(levelLayer);
                }

                level.tileLayers.Reverse();             // Sort them bottom to top again

                // Load objects
                var groups = map.ObjectGroups;

                // Dictionaries used to link entities together by name
                var guardPaths      = new Dictionary <Guard, string>();
                var carPaths        = new Dictionary <Car, string>();
                var paths           = new Dictionary <string, List <Vector2> >();
                var consoles        = new Dictionary <string, PC>();
                var cameraConsole   = new Dictionary <CCTV, string>();
                var objectives      = new Dictionary <string, Objective>(); // Remains during gameplay due to some triggers needing it
                var pcWithObjective = new Dictionary <PC, string>();
                var driveObjective  = new Dictionary <DrivableVehicle, string>();

                // Loop trough all objects
                foreach (var objectGroup in groups)
                {
                    foreach (var obj in objectGroup.Objects)
                    {
                        // Small fix for spawn position with some entities
                        var halfTileOffset = -new Vector2(-level.TileWidth, level.TileHeight) / 2;

                        // Check type and create appropriate objects and entities
                        WorldEntity entity = null;
                        if (obj.Type == "spawnpoint")
                        {
                            entity          = new SpawnPoint(new Vector2((float)obj.X, (float)obj.Y) + halfTileOffset);
                            entity.Rotation = MathHelper.ToRadians((float)obj.Rotation);
                        }
                        else if (obj.Type == "guard")
                        {
                            entity          = new Guard();
                            entity.Position = new Vector2((float)obj.X, (float)obj.Y) + halfTileOffset;
                            entity.Rotation = MathHelper.ToRadians((float)obj.Rotation);

                            string path;
                            if (obj.Properties.TryGetValue("patrolpath", out path))
                            {
                                guardPaths.Add(entity as Guard, path);
                            }
                        }
                        else if (obj.Type == "car")
                        {
                            entity          = new Car(new Vector2((float)obj.X, (float)obj.Y) + halfTileOffset, null, "Sprites/Car");
                            entity.Rotation = MathHelper.ToRadians((float)obj.Rotation);

                            string path;
                            if (obj.Properties.TryGetValue("path", out path))
                            {
                                carPaths.Add(entity as Car, path);
                            }
                        }
                        else if (obj.Type == "bird")
                        {
                            entity = new Bird()
                            {
                                YResetValue = level.Height * level.TileHeight + 200
                            };
                            entity.Position = new Vector2((float)obj.X, (float)obj.Y) + halfTileOffset;
                            entity.Rotation = MathHelper.ToRadians((float)obj.Rotation);
                        }
                        else if (obj.Type == "helicopter")
                        {
                            entity          = new Helicopter();
                            entity.Position = new Vector2((float)obj.X, (float)obj.Y) + halfTileOffset;
                            entity.Rotation = MathHelper.ToRadians((float)obj.Rotation);

                            string objective;
                            if (obj.Properties.TryGetValue("objective", out objective))
                            {
                                driveObjective.Add(entity as DrivableVehicle, objective);
                            }
                        }
                        else if (obj.Type == "jeep")
                        {
                            entity          = new Jeep();
                            entity.Position = new Vector2((float)obj.X, (float)obj.Y) + halfTileOffset;
                            entity.Rotation = MathHelper.ToRadians((float)obj.Rotation);

                            string objective;
                            if (obj.Properties.TryGetValue("objective", out objective))
                            {
                                driveObjective.Add(entity as DrivableVehicle, objective);
                            }
                            string autoEnter;
                            if (obj.Properties.TryGetValue("autoenter", out autoEnter))
                            {
                                (entity as Jeep).autoenter = true;
                            }
                            string creditmode;
                            if (obj.Properties.TryGetValue("creditmode", out creditmode))
                            {
                                (entity as Jeep).creditsMode = true;
                            }
                        }
                        else if (obj.Type == "tank")
                        {
                            entity          = new Tank();
                            entity.Position = new Vector2((float)obj.X, (float)obj.Y) + halfTileOffset;
                            entity.Rotation = MathHelper.ToRadians((float)obj.Rotation);

                            string objective;
                            if (obj.Properties.TryGetValue("objective", out objective))
                            {
                                driveObjective.Add(entity as DrivableVehicle, objective);
                            }
                            string creditmode;
                            if (obj.Properties.TryGetValue("creditmode", out creditmode))
                            {
                                (entity as Tank).creditsMode = true;
                            }
                        }
                        else if (obj.Type == "objective")
                        {
                            string description;
                            string index;

                            if (obj.Properties.TryGetValue("description", out description))
                            {
                                if (obj.Properties.TryGetValue("index", out index))
                                {
                                    int ind       = Int32.Parse(index);
                                    bool newIndex = true;

                                    foreach (var item in objectives)
                                    {
                                        if (item.Value.Index == ind)
                                        {
                                            newIndex = false;
                                        }
                                    }
                                    if (newIndex)
                                    {
                                        entity = new Objective(description, ind);
                                        objectives.Add(obj.Name, entity as Objective);
                                    }
                                }
                            }
                        }
                        else if (obj.Type == "cctv")
                        {
                            entity          = new CCTV();
                            entity.Position = new Vector2((float)obj.X, (float)obj.Y) + halfTileOffset;
                            entity.Rotation = MathHelper.ToRadians((float)obj.Rotation);

                            string console;
                            if (obj.Properties.TryGetValue("pc", out console))
                            {
                                cameraConsole.Add(entity as CCTV, console);
                            }
                        }
                        else if (obj.Type == "pc")
                        {
                            entity          = new PC();
                            entity.Position = new Vector2((float)obj.X, (float)obj.Y);
                            entity.Rotation = MathHelper.ToRadians((float)obj.Rotation);

                            string objective;
                            if (obj.Properties.TryGetValue("objective", out objective))
                            {
                                pcWithObjective.Add(entity as PC, objective);
                            }

                            if (!consoles.ContainsKey(obj.Name))
                            {
                                consoles[obj.Name] = entity as PC;
                            }
                            else
                            {
                                Debug.WriteLine("Duplicate PC name " + obj.Name);
                            }
                        }
                        else if (obj.Type == "audio")
                        {
                            // Global audio
                            string audio;
                            string loop;
                            string volume;
                            bool willWork = true;

                            if (!obj.Properties.TryGetValue("source", out audio))
                            {
                                willWork = false;
                            }
                            if (!obj.Properties.TryGetValue("loop", out loop))
                            {
                                loop = "true";
                            }
                            if (!obj.Properties.TryGetValue("volume", out volume))
                            {
                                volume = "1";
                            }

                            if (willWork)
                            {
                                var soundEffect      = MonoGearGame.GetResource <SoundEffect>(audio).CreateInstance();
                                soundEffect.IsLooped = (loop == "true");
                                soundEffect.Volume   = float.Parse(volume) * SettingsPage.Volume * SettingsPage.EffectVolume;
                                AudioManager.PlayGlobal(soundEffect);
                                Debug.WriteLine("Added audio " + audio);
                                Debug.WriteLine("With Volume " + soundEffect.Volume);
                            }
                            else
                            {
                                Debug.WriteLine("Could not add audio" + audio);
                            }
                        }
                        else if (obj.Type == "audiosource")
                        {
                            // Positional audio
                            string audio;
                            string range;
                            string volume;

                            if (obj.Properties.TryGetValue("source", out audio))
                            {
                                if (!obj.Properties.TryGetValue("range", out range))
                                {
                                    range = "100";
                                }
                                if (!obj.Properties.TryGetValue("volume", out volume))
                                {
                                    volume = "1";
                                }
                                AudioManager.AddPositionalAudio(MonoGearGame.GetResource <SoundEffect>(audio), float.Parse(volume), float.Parse(range), new Vector2((float)obj.X, (float)obj.Y), true);
                            }
                        }
                        else if (obj.Type == "trigger")
                        {
                            string action;
                            if (obj.Properties.TryGetValue("action", out action))
                            {
                                Action <Collider, IEnumerable <Collider>, IEnumerable <Collider> > actionL = null;
                                if (action == "nextlevel")
                                {
                                    // Action for going to a next level
                                    actionL = (self, previous, current) =>
                                    {
                                        foreach (var col in current)
                                        {
                                            var vehicle = col.Entity as DrivableVehicle;
                                            if (col.Entity.Tag == "Player" || (vehicle != null && vehicle.Entered))
                                            {
                                                if (vehicle != null && vehicle.Entered)
                                                {
                                                    vehicle.Exit();
                                                }
                                                MonoGearGame.NextLevel();
                                            }
                                        }
                                    };
                                }
                                else if (action == "alert")
                                {
                                    // Action for alerting all guards to the players position
                                    actionL = (self, previous, current) =>
                                    {
                                        foreach (var col in current)
                                        {
                                            var vehicle = col.Entity as DrivableVehicle;
                                            if ((col.Entity.Tag == "Player" || (vehicle != null && vehicle.Entered)) && !previous.Contains(col))
                                            {
                                                var guards = MonoGearGame.FindEntitiesOfType <Guard>();
                                                foreach (var guard in guards)
                                                {
                                                    guard.Alert(col.Entity.Position);
                                                }
                                            }
                                        }
                                    };
                                }
                                else if (action == "objective")
                                {
                                    // Action for clearing an objective
                                    string objective;
                                    if (obj.Properties.TryGetValue("objective", out objective))
                                    {
                                        actionL = (self, previous, current) =>
                                        {
                                            foreach (var col in current)
                                            {
                                                var vehicle = col.Entity as DrivableVehicle;
                                                if (col.Entity.Tag == "Player" || (vehicle != null && vehicle.Entered))
                                                {
                                                    Objective ob;
                                                    if (objectives.TryGetValue(objective, out ob))
                                                    {
                                                        GameUI.CompleteObjective(ob);
                                                    }
                                                    else
                                                    {
                                                        Debug.WriteLine("Trgger could not find objective: " + objectives);
                                                    }
                                                }
                                            }
                                        };
                                    }
                                }
                                else
                                {
                                    Debug.WriteLine("Trigger " + obj.Name + " with unknown action " + action);
                                }

                                if (actionL != null)
                                {
                                    var size = new Vector2((float)obj.Width, (float)obj.Height);
                                    entity   = new WorldBoxTrigger(new Vector2((float)obj.X, (float)obj.Y) + size / 2,
                                                                   size,
                                                                   actionL);
                                }
                            }
                            else
                            {
                                Debug.WriteLine("Trigger " + obj.Name + " with no action!");
                            }
                        }
                        else if (obj.Type == "path")
                        {
                            // A patrol path
                            if (!paths.ContainsKey(obj.Name))
                            {
                                paths[obj.Name] = new List <Vector2>();
                                foreach (var point in obj.Points)
                                {
                                    paths[obj.Name].Add(new Vector2((float)point.X + (float)obj.X, (float)point.Y + (float)obj.Y));
                                }
                            }
                            else
                            {
                                Debug.WriteLine("Duplicate path name " + obj.Name);
                            }
                        }

                        if (entity != null)
                        {
                            // Set tag
                            string tag;
                            if (obj.Properties.TryGetValue("tag", out tag))
                            {
                                entity.Tag = tag;
                            }

                            level.AddEntity(entity);
                        }
                    }
                }

                // Assing guard patrol paths
                foreach (var guardPath in guardPaths)
                {
                    List <Vector2> path;
                    if (paths.TryGetValue(guardPath.Value, out path))
                    {
                        guardPath.Key.PatrolPath = path;
                    }
                    else
                    {
                        Debug.WriteLine("Guard requested unknown path " + guardPath.Value);
                    }
                }

                // Assing car paths
                foreach (var carPath in carPaths)
                {
                    List <Vector2> path;
                    if (paths.TryGetValue(carPath.Value, out path))
                    {
                        carPath.Key.SetPath(path);
                    }
                    else
                    {
                        Debug.WriteLine("Car requested unknown path " + carPath.Value);
                    }
                }

                // Assing PC/CCTV
                foreach (var kvPair in cameraConsole)
                {
                    PC pc;
                    if (consoles.TryGetValue(kvPair.Value, out pc))
                    {
                        pc.AddCCTV(kvPair.Key);
                    }
                    else
                    {
                        Debug.WriteLine("CCTV requested unknown PC " + kvPair.Value);
                    }
                }

                // Assing PC/Objective
                foreach (var pc in pcWithObjective)
                {
                    Objective ob;
                    if (objectives.TryGetValue(pc.Value, out ob))
                    {
                        pc.Key.Objective = ob;
                    }
                    else
                    {
                        Debug.WriteLine("PC could not find objective: " + pc.Value);
                    }
                }

                // Assing drive/Objective
                foreach (var drive in driveObjective)
                {
                    Objective ob;
                    if (objectives.TryGetValue(drive.Value, out ob))
                    {
                        drive.Key.objective = ob;
                    }
                    else
                    {
                        Debug.WriteLine("PC could not find objective: " + drive.Value);
                    }
                }
            }).Wait();
            return(level);
        }
Exemple #24
0
    }                                                                             // 0x00000001814EEF50-0x00000001814EF040

    public void u091Au091Au091Eu091Du0929u091Fu0923u091Eu0926u0929u0921(CCTV u091Cu091Fu0922u0927u091Bu091Bu0922u091Eu091Au091Au0928)
    {
    }                                                                                                                                        // 0x00000001814E7C40-0x00000001814E7D40
Exemple #25
0
        public static void NewCCTVInformation(STATIONNAME StationName, DEVICENAME DeviceName, CCTV FieldName, Object Value, DateTime DataTimestamp)
        {
            StationHandler ExistingStation = KeeperData.FirstOrDefault(Item => Item.StationName == StationName);

            if (ExistingStation != null)
            {
                ExistingStation.NewCCTVInformation(DeviceName, FieldName, Value, DataTimestamp);
            }
        }
Exemple #26
0
    }                                                                                                                                         // 0x00000001814EBC90-0x00000001814EBEA0

    public void u091Cu0928u091Fu091Du0923u091Eu0920u0925u091Au091Fu0924(CCTV u091Cu091Fu0922u0927u091Bu091Bu0922u091Eu091Au091Au0928)
    {
    }                                                                                                                                        // 0x00000001814E8AB0-0x00000001814E8BB0
Exemple #27
0
 public void GetStructure(ASTROCLIENT Astroclient, TS700MM TS700mm, ASTROHEVENDOME Dome, IMAGING Imaging, SQM Sqm, SEEING Seeing, ALLSKY Allsky, WEATHERSTATION Weatherstation, LANOUTLET Lanoutlet, CCTV CCTV, GPS GPS, ASTROSERVER Astroserver)
 {
 }
Exemple #28
0
 //Methode, um von außerhalb die Coroutine zu starten
 public void GoToCameraAlarm(Vector3 _target, CCTV _callingCamera)
 {
     StartCoroutine(CameraAlarmCoroutine(_target, _callingCamera));
 }
Exemple #29
0
    }                                                                             // 0x00000001814E8750-0x00000001814E8840

    public void u0924u0925u091Au0920u091Bu091Eu0925u0929u0920u0924u091F(CCTV u091Cu091Fu0922u0927u091Bu091Bu0922u091Eu091Au091Au0928)
    {
    }                                                                                                                                        // 0x00000001814EDC60-0x00000001814EDE10
        private void loadSiteCCTV(vwSiteDegree site)
        {
            // throw new NotImplementedException();
            MapApplication.Web.DbContext db = new Web.DbContext();
            string site_id = site.SITE_ID;
            EntityQuery<tblCCTV> qry = from n in db.GetTblCCTVQuery() where n.SITE_ID == site_id select n;
            LoadOperation<tblCCTV> lo = db.Load<tblCCTV>(qry);

            lo.Completed += (s, a) =>
               {
                   if (lo.Error != null)
                   {
                       MessageBox.Show(lo.Error.Message);
                       return;

                   }
                   dictCCTVs.Clear();
                   this.lstCCTV.ItemsSource = lo.Entities;
                   foreach (tblCCTV cctvInfo  in lo.Entities   )
                   {
                       ElementLayer lyr = this.map1.Layers["sensorLyr"] as ElementLayer;
                       CCTV sensor = new CCTV();

                       MapPoint mp = ConvertMapPointTo102100(new MapPoint((double)cctvInfo.X, (double)cctvInfo.Y));
                       sensor.DataContext = cctvInfo;

                       ElementLayer.SetEnvelope(sensor, new Envelope(mp, mp));
                       dictCCTVs.Add(cctvInfo.CCTV_ID, sensor);
                       lyr.Children.Add(sensor);
                   }

               };
        }
Exemple #31
0
    }                                                                                                                                        // 0x00000001814EDC60-0x00000001814EDE10

    public void RemoveCamera(CCTV u091Cu091Fu0922u0927u091Bu091Bu0922u091Eu091Au091Au0928)
    {
    }                                                                                             // 0x00000001814E7170-0x00000001814E7320