Exemple #1
0
 public Item(string View, int Axis1, int Axis2, string item_id, string item_name)
 {
     if (View == "XY") // "Front" view, Axis1 = X, Axis2 = Y
     {
         this.Position.X = Axis1;
         this.Position.Y = Axis2;
         this.Position.Z = 0;
     }
     else if (View == "ZY") // "Left" view, Axis1 = Z, Axis2 = Y
     {
         this.Position.X = 0;
         this.Position.Y = Axis2;
         this.Position.Z = Axis1;
     }
     else if (View == "XZ") // "Top" view, Axis1 = X, Axis2 = Z
     {
         this.Position.X = Axis1;
         this.Position.Y = 0;
         this.Position.Z = Axis2;
     }
     else
     {
         MessageBox.Show("Item Created with invalid view");
     }
     this._iItemType = item_id;
     this._name = item_name;
     this._layer = LayerEnum.Layer1;
 }
        static ResultContext()
        {
            var config = GetConfiguration();

            Layer           = config.Layer;
            ApplicationName = config.ApplicationName;
        }
Exemple #3
0
    ///
    /// Lasse Gegenstand fallen
    /// Lässt aktuellen Gegenstand fallen
    ///
    public void dropItem()
    {
        if (currentItem != null)
        {
            BroadcastMessage("hidePlayer");
            LayerEnum playerLayer = gameObject.GetComponent <Moving>().layer;
            switch (playerLayer)
            {
            case LayerEnum.BACK:
                currentItem.transform.parent.parent = GameObject.FindGameObjectWithTag("layer_back").transform;
                break;

            case LayerEnum.MID:
                currentItem.transform.parent.parent = GameObject.FindGameObjectWithTag("layer_mid").transform;
                break;

            case LayerEnum.FRONT:
                currentItem.transform.parent.parent = GameObject.FindGameObjectWithTag("layer_front").transform;
                break;
            }
            currentItem.GetComponent <Hide>().show(0);

            float   xOffset = (frontOfDoor) ? 0.5f : 0f;
            Vector3 tempPos = new Vector3(gameObject.transform.position.x + xOffset, gameObject.transform.position.y, gameObject.transform.position.z + 0.5f);
            currentItem.transform.position = tempPos;
            currentItem.GetComponent <Item>().currentLayer = gameObject.GetComponent <Moving>().layer;
            currentItem.SetActive(true);
            currentItem = null;
        }
    }
 public override System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> ReadFields(System.IO.BinaryReader binaryReader)
 {
     System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> pointerQueue = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(base.ReadFields(binaryReader));
     this.DecalFlags             = ((Flags)(binaryReader.ReadInt16()));
     this.Type                   = ((TypeEnum)(binaryReader.ReadInt16()));
     this.Layer                  = ((LayerEnum)(binaryReader.ReadInt16()));
     this.MaxOverlappingCount    = binaryReader.ReadInt16();
     this.NextDecalInChain       = binaryReader.ReadTagReference();
     this.Radius                 = binaryReader.ReadRange();
     this.RadiusOverlapRejection = binaryReader.ReadSingle();
     this.ColorLowerBounds       = binaryReader.ReadColorR8G8B8();
     this.ColorUpperBounds       = binaryReader.ReadColorR8G8B8();
     this.Lifetime               = binaryReader.ReadRange();
     this.DecayTime              = binaryReader.ReadRange();
     this.fieldpad               = binaryReader.ReadBytes(40);
     this.fieldpad0              = binaryReader.ReadBytes(2);
     this.fieldpad1              = binaryReader.ReadBytes(2);
     this.fieldpad2              = binaryReader.ReadBytes(2);
     this.fieldpad3              = binaryReader.ReadBytes(2);
     this.fieldpad4              = binaryReader.ReadBytes(20);
     this.Bitmap                 = binaryReader.ReadTagReference();
     this.fieldpad5              = binaryReader.ReadBytes(20);
     this.MaximumSpriteExtent    = binaryReader.ReadSingle();
     this.fieldpad6              = binaryReader.ReadBytes(4);
     return(pointerQueue);
 }
Exemple #5
0
 public override void PaintHandler(LayerEnum target_layer, PanelTransform tform, Graphics g)
 {
     if (show)
     {
         pin.DrawObject(target_layer, tform, g);
     }
 }
Exemple #6
0
        // Draw pin on panel
        public override void DrawObject(LayerEnum target_layer, PanelTransform tform, Graphics g, bool selected = false)
        {
            if (layer != LayerEnum.BOTH && target_layer != layer)
            {
                // no drawing on this layer
                return;
            }

            var loc = tform(new RelativePoint(Location.X, Location.Y));

            if (selected)
            {
                using (var p = new Pen(Color.FromArgb(180, PinColor), 6))
                {
                    const int hs = 7;
                    g.DrawRectangle(p, loc.X - hs, loc.Y - hs, hs * 2, hs * 2);
                }
            }

            using (var p = new Pen(PinColor, 2))
            {
                const int hs = 5;
                g.DrawRectangle(p, loc.X - hs, loc.Y - hs, hs * 2, hs * 2);
            }
        }
Exemple #7
0
        public void SetLayer(LayerEnum layer, string json)
        {
            var data = new Settings();

            JsonConvert.PopulateObject(json, data);
            _layers[layer] = data;
        }
        public static ILayer InitializeLayer(LayerEnum type)
        {
            // Initialize the appropriate decoder
            switch (type)
            {
            case LayerEnum.None:
                return(null);

            case LayerEnum.Layer0:
                return(new Layer0());

            case LayerEnum.Layer1:
                return(new Layer1());

            case LayerEnum.Layer2:
                return(new Layer2());

            case LayerEnum.Layer3:
                return(new Layer3());

            case LayerEnum.Layer4:
                return(new Layer4());

            case LayerEnum.Layer5:
                return(new Layer5());

            default:
                throw new ArgumentException("Invalid Layer Enumeration provided");
            }
        }
Exemple #9
0
    ///
    /// Aktiviere Layer Wechsel
    /// @param layer Ebene, in die gewechselt werden soll
    ///
    public void switchLayers(LayerEnum layer)
    {
        // Startzeit und -position für den Lerp
        startTime = Time.time;
        startPos  = transform.position;

        // Erhalte Z-Position der Layer, in die gewechselt werden soll
        float zPos = 0f;

        switch (layer)
        {
        case LayerEnum.FRONT:
            zPos = GameObject.FindWithTag("layer_front").transform.localPosition.z;
            break;

        case LayerEnum.MID:
            zPos = GameObject.FindWithTag("layer_mid").transform.localPosition.z;
            break;

        case LayerEnum.BACK:
            zPos = GameObject.FindWithTag("layer_back").transform.localPosition.z;
            break;
        }

        // Setze Enposition mit aktueller X und Y Position und neu erhaltenen Z-Position der Ebene
        endPos   = new Vector3(transform.position.x, transform.position.y, zPos);
        endLayer = layer;

        // set journey length with the 2 positions
        journeyLength = Vector3.Distance(startPos, endPos);
        active        = true;
    }
Exemple #10
0
        // Run Object Limiter Removal When Deleting Objects
        public void RunLimiterDeletion(LayerEnum layerEnum, short gridX, short gridY)
        {
            if (layerEnum == LayerEnum.main)
            {
                RoomFormat roomData = this.levelContent.data.rooms[roomID];

                string strX = gridX.ToString();
                string strY = gridY.ToString();

                if (roomData.main.ContainsKey(strY) && roomData.main[strY].ContainsKey(strX))
                {
                    byte tileId  = byte.Parse(roomData.main[strY][strX][0].ToString());
                    byte subType = byte.Parse(roomData.main[strY][strX][1].ToString());
                    this.scene.limiter.RemoveLimitTile(this.scene.curRoomID, tileId, subType);
                }
            }

            else if (layerEnum == LayerEnum.obj)
            {
                RoomFormat roomData = this.levelContent.data.rooms[roomID];

                string strX = gridX.ToString();
                string strY = gridY.ToString();

                if (roomData.obj.ContainsKey(strY) && roomData.obj[strY].ContainsKey(strX))
                {
                    byte objectID = byte.Parse(roomData.obj[strY][strX][0].ToString());
                    this.scene.limiter.RemoveObject(this.scene.curRoomID, objectID);
                }
            }
        }
Exemple #11
0
 public IMetaData(Arch arch, Atlas atlas, SlotGroup slotGroup, LayerEnum layer, LoadOrder loadOrder)
 {
     this.Archetype = arch;
     this.LoadOrder = loadOrder;
     this.Atlas     = atlas;
     this.SlotGroup = slotGroup;
     this.Layer     = layer;
 }
Exemple #12
0
 public void DeleteTileOnLayer(LayerEnum layerEnum, short gridX, short gridY)
 {
     if (!this.ConfirmPlace(gridX, gridY))
     {
         return;
     }
     this.RunLimiterDeletion(layerEnum, gridX, gridY);
     this.levelContent.DeleteTileOnLayer(layerEnum, this.roomID, gridX, gridY);
 }
 public override System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> ReadFields(System.IO.BinaryReader binaryReader)
 {
     System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> pointerQueue = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(base.ReadFields(binaryReader));
     this.Layer     = ((LayerEnum)(binaryReader.ReadInt16()));
     this.fieldpad  = binaryReader.ReadBytes(2);
     this.Pass      = binaryReader.ReadTagReference();
     this.fieldpad0 = binaryReader.ReadBytes(12);
     return(pointerQueue);
 }
 public Collider(GameObject go) : base(go)
 {
     worldMatrix           = Matrix.Identity;
     this.TriggerReasons   = new List <Collider>();
     this.IgnoredColliders = new List <Collider>();
     CustomScale           = new Vector3(1.0f, 1.0f, 1.0f);
     CustomOffset          = Vector3.Zero;
     Layer = LayerEnum.DEFAULT;
     this.CreateCollider();
 }
Exemple #15
0
 ///
 /// Use this for initialization
 ///
 void Start()
 {
     //moveSpeed = 2f; // 2 m/s Bewegungsgeschw.
     if (gameObject.GetComponent <Character>() != null)
     {
         layer      = LayerEnum.FRONT;
         houseLevel = HouseLevelEnum.LOWER;
     }
     viewDirection = DirectionEnum.LEFT;         // schaut nach links
     moveDirection = DirectionEnum.NONE;         // keine Bewegung am Anfang
 }
 public Collider(GameObject go, Collider c) : base(go)
 {
     this.worldMatrix      = c.worldMatrix;
     this.IsTrigger        = c.IsTrigger;
     this.TriggerReasons   = new List <Collider>();
     this.IgnoredColliders = new List <Collider>();
     CustomScale           = c.CustomScale;
     CustomOffset          = c.CustomOffset;
     Layer = LayerEnum.DEFAULT;
     this.CreateCollider();
 }
Exemple #17
0
        // Moves the Tile JSON (per the currently indexed [static] grid coordinate trackers) with the new data:
        protected void MoveTileDataToLayer(LayerEnum newLayerEnum, byte tileId, byte subTypeId, Dictionary <string, short> paramList = null)
        {
            RoomFormat roomData = this.levelContent.data.rooms[curRoomId];
            Dictionary <string, Dictionary <string, ArrayList> > roomLayer = null;

            // Get the layer property with a switch.
            if (LevelConvert.curRoomLayerId == "main")
            {
                roomLayer = roomData.main;
            }
            else if (LevelConvert.curRoomLayerId == "obj")
            {
                roomLayer = roomData.obj;
            }
            else if (LevelConvert.curRoomLayerId == "bg")
            {
                roomLayer = roomData.bg;
            }
            else if (LevelConvert.curRoomLayerId == "fg")
            {
                roomLayer = roomData.fg;
            }

            // Remove the Layer
            if (roomLayer != null)
            {
                roomLayer[curGridY.ToString()].Remove(curGridX.ToString());
            }

            // Move to New Layer
            var newLayer = LevelContent.GetLayerData(roomData, newLayerEnum);

            if (paramList == null)
            {
                if (!newLayer.ContainsKey(curGridY.ToString()))
                {
                    newLayer.Add(curGridY.ToString(), new Dictionary <string, ArrayList>());
                }
                newLayer[curGridY.ToString()][curGridX.ToString()] = new ArrayList {
                    tileId, subTypeId
                };
            }
            else
            {
                if (!newLayer.ContainsKey(curGridY.ToString()))
                {
                    newLayer.Add(curGridY.ToString(), new Dictionary <string, ArrayList>());
                }
                newLayer[curGridY.ToString()][curGridX.ToString()] = new ArrayList {
                    tileId, subTypeId, paramList
                };
            }
        }
Exemple #18
0
    public string GetLayerName(LayerEnum layer)
    {
        if (LayerDict.ContainsKey(layer))
        {
            return(LayerDict[layer]);
        }

        else
        {
            Debug.LogError($"Layer {layer} is not a key in LayerDict!");
            return(null);
        }
    }
Exemple #19
0
    public int GetLayer(LayerEnum layer)
    {
        if (LayerDict.ContainsKey(layer))
        {
            return(LayerMask.NameToLayer(LayerDict[layer]));
        }

        else
        {
            Debug.LogError($"Layer {layer} is not a key in LayerDict!");
            return(-1);
        }
    }
Exemple #20
0
 public AbstractTool(int layer = 0)
 {
     // interpret layer selection dropdown menu
     if (layer == 0)
     {
         ActiveLayer = LayerEnum.TOP;
     }
     else if (layer == 1)
     {
         ActiveLayer = LayerEnum.BOTTOM;
     }
     else
     {
         ActiveLayer = LayerEnum.BOTH;
     }
 }
Exemple #21
0
        public void StartAutoTile(byte tileId, byte subTypeId, LayerEnum layerEnum, short gridX, short gridY)
        {
            this.autoGroup = AutoTileTool.IdentifyAutoGroup(tileId);

            if (this.autoGroup == AutoGroup.None)
            {
                this.ClearAutoTiles();
                return;
            }

            this.startFrame = Systems.timer.Frame;
            this.tileId     = tileId;
            this.subTypeId  = subTypeId;
            this.layerEnum  = layerEnum;
            this.xStart     = gridX;
            this.yStart     = gridY;
        }
Exemple #22
0
        public override void DrawObject(LayerEnum target_layer, PanelTransform tform, Graphics g, bool selected = false)
        {
            if (layer != LayerEnum.BOTH && target_layer != layer)
            {
                // no drawing on this layer
                return;
            }

            for (int i = 0; i < WirePoints.Count - 1; i++)
            {
                DrawLine(WirePoints[i], WirePoints[i + 1], tform, g, selected);
            }

            if (ShowActivePoint && WirePoints.Count > 0)
            {
                DrawLine(WirePoints[WirePoints.Count - 1], ActivePoint, tform, g, selected);
            }
        }
Exemple #23
0
        private static void AddTileToScene(RoomScene room, LayerEnum layerEnum, short gridX, short gridY, byte tileId, byte subType = 0, Dictionary <string, short> paramList = null)
        {
            // Adjust for World Gaps
            gridX += (byte)TilemapEnum.GapLeft;
            gridY += (byte)TilemapEnum.GapUp;

            if (layerEnum == LayerEnum.main)
            {
                room.tilemap.SetMainTile(gridX, gridY, tileId, subType);
                if (paramList != null)
                {
                    room.tilemap.SetParamList(gridX, gridY, paramList);
                }
            }
            else if (layerEnum == LayerEnum.bg)
            {
                room.tilemap.SetBGTile(gridX, gridY, tileId, subType);
            }
            else if (layerEnum == LayerEnum.fg)
            {
                room.tilemap.SetFGTile(gridX, gridY, tileId, subType);
            }
        }
Exemple #24
0
        public void DrawBlueprintByLayer(LayerEnum layerEnum, short x, short y, short xStart, short yStart)
        {
            // Get the value stored in this blueprint at correct tile position:
            ArrayList bpData = this.gridTrack[(byte)layerEnum, y, x];

            if (bpData == null)
            {
                return;
            }

            // Verify that a TileID (or ObjectID) is present
            byte objOrTileID = byte.Parse(bpData[0].ToString());

            if (objOrTileID == 0)
            {
                return;
            }

            // Drawing Objects
            if (layerEnum == LayerEnum.obj)
            {
                ShadowTile.Draw(objOrTileID, byte.Parse(bpData[1].ToString()), null, (xStart + x) * (byte)TilemapEnum.TileWidth - Systems.camera.posX, (yStart + y) * (byte)TilemapEnum.TileHeight - Systems.camera.posY);
            }

            // Drawing Tiles
            else
            {
                var tileDict = Systems.mapper.TileDict;

                if (tileDict.ContainsKey(objOrTileID))
                {
                    TileObject tgo = tileDict[objOrTileID];
                    tgo.Draw(null, byte.Parse(bpData[1].ToString()), (xStart + x) * (byte)TilemapEnum.TileWidth - Systems.camera.posX, (yStart + y) * (byte)TilemapEnum.TileHeight - Systems.camera.posY);
                }
            }
        }
Exemple #25
0
        public void DeleteTileOnLayer(LayerEnum layerEnum, byte roomID, short gridX, short gridY)
        {
            RoomFormat roomData = this.data.rooms[roomID];

            string strX = gridX.ToString();
            string strY = gridY.ToString();

            if (layerEnum == LayerEnum.obj && roomData.obj.ContainsKey(strY))
            {
                roomData.obj[strY].Remove(strX);
            }
            else if (layerEnum == LayerEnum.main && roomData.main.ContainsKey(strY))
            {
                roomData.main[strY].Remove(strX);
            }
            else if (layerEnum == LayerEnum.fg && roomData.fg.ContainsKey(strY))
            {
                roomData.fg[strY].Remove(strX);
            }
            else if (layerEnum == LayerEnum.bg && roomData.bg.ContainsKey(strY))
            {
                roomData.bg[strY].Remove(strX);
            }
        }
Exemple #26
0
 public static int GetLayer(LayerEnum layer)
 {
     return(LayerMask.NameToLayer(layer.ToString()));
 }
Exemple #27
0
        private static void GenerateTileLayer(RoomScene room, Dictionary <string, Dictionary <string, ArrayList> > layer, LayerEnum layerEnum)
        {
            var TileDict = Systems.mapper.TileDict;

            // Loop through YData within the Layer Provided:
            foreach (KeyValuePair <string, Dictionary <string, ArrayList> > yData in layer)
            {
                short gridY = short.Parse(yData.Key);

                // Loop through XData
                foreach (KeyValuePair <string, ArrayList> xData in yData.Value)
                {
                    short gridX = short.Parse(xData.Key);

                    byte tileId  = Convert.ToByte(xData.Value[0]);
                    byte subType = Convert.ToByte(xData.Value[1]);
                    Dictionary <string, short> paramList = null;

                    if (xData.Value.Count > 2)
                    {
                        // ERRORS HERE MEAN: The json data saved a string instead of a short; e.g. {"Suit", "WhiteNinja"} instead of {"Suit", 2}
                        // To fix it, we need to run LevelConvert updates that make the appropriate changes.
                        paramList = JsonConvert.DeserializeObject <Dictionary <string, short> >(xData.Value[2].ToString());
                    }

                    // Check the TileDict to identify setup requirements. If it does, run it's setup process.
                    TileObject tile = TileDict[tileId];

                    // If the tile is considered "Pre-Setup Only" - only run its pre-setup method; don't add it to the scene.
                    if (tile.setupRules == SetupRules.PreSetupOnly)
                    {
                        (tile as dynamic).PreSetup(room, (short)(gridX + (byte)TilemapEnum.GapLeft), (short)(gridY + (byte)TilemapEnum.GapUp), tileId, subType, paramList);
                        continue;
                    }

                    RoomGenerate.AddTileToScene(room, layerEnum, gridX, gridY, tileId, subType, paramList);

                    // Post Setup
                    if (tile.setupRules >= SetupRules.SetupTile)
                    {
                        (tile as dynamic).SetupTile(room, (short)(gridX + (byte)TilemapEnum.GapLeft), (short)(gridY + (byte)TilemapEnum.GapUp));
                    }
                }
            }
        }
Exemple #28
0
        public void AddToBlueprintTile(Dictionary <string, Dictionary <string, ArrayList> > layerData, LayerEnum layerEnum, short x, short y, string xPos, string yPos)
        {
            if (!layerData.ContainsKey(yPos) || !layerData[yPos].ContainsKey(xPos))
            {
                this.gridTrack[(byte)layerEnum, y, x] = null;
                return;
            }

            // Save the value stored in this blueprint at correct tile position:
            var tileData = layerData[yPos][xPos];

            this.gridTrack[(byte)layerEnum, y, x] = tileData;
        }
Exemple #29
0
        public void PasteBlueprintByLayer(EditorRoomScene scene, Dictionary <string, Dictionary <string, ArrayList> > layerData, LayerEnum layerEnum, short x, short y, short xStart, short yStart)
        {
            // Get the value stored in this blueprint at correct tile position:
            ArrayList bpData = this.gridTrack[(byte)layerEnum, y, x];

            if (bpData == null)
            {
                return;
            }

            // Copy the blueprint at correct tile position in level editor:
            if (bpData.Count > 2)
            {
                Dictionary <string, short> paramsList;

                if (bpData[2] is IDictionary)
                {
                    paramsList = (Dictionary <string, short>)bpData[2];
                }
                else
                {
                    paramsList = JsonConvert.DeserializeObject <Dictionary <string, short> >(bpData[2].ToString());
                }

                scene.PlaceTile(layerData, layerEnum, (short)(xStart + x), (short)(yStart + y), byte.Parse(bpData[0].ToString()), byte.Parse(bpData[1].ToString()), paramsList);
            }
            else
            {
                scene.PlaceTile(layerData, layerEnum, (short)(xStart + x), (short)(yStart + y), byte.Parse(bpData[0].ToString()), byte.Parse(bpData[1].ToString()));
            }
        }
Exemple #30
0
 public static Dictionary <string, Dictionary <string, ArrayList> > GetLayerData(RoomFormat roomData, LayerEnum layerEnum)
 {
     if (layerEnum == LayerEnum.main)
     {
         return(roomData.main);
     }
     if (layerEnum == LayerEnum.obj)
     {
         return(roomData.obj);
     }
     if (layerEnum == LayerEnum.bg)
     {
         return(roomData.bg);
     }
     if (layerEnum == LayerEnum.fg)
     {
         return(roomData.fg);
     }
     return(null);
 }
Exemple #31
0
    static public void SetLayer(GameObject go, LayerEnum layerEnum)
    {
        int layer = GetLayer(layerEnum);

        SetLayer(go, layer);
    }
 private void ChangeToLayer(LayerEnum layer)
 {
     this.gameObject.layer = (int)layer;
             _gm.ChangeToLayer (layer);
             grounded = false;
 }