Пример #1
0
        public void commitSingleRoom(UInt16 value, int layer, int x, int y, Map map)
        {
            int finalIndex = y + x * 200;

            finalIndex += map.verticalHeights.Take <int>(map.currentRoomY).Sum();
            finalIndex += map.currentRoomX * 4000;
            map.roomLayerArray[layer][finalIndex] = value;
            IntPtr targetAddress = IntPtr.Add(upperLeftRoomArray[layer], finalIndex * 2);

            MemoryApi.WriteMemoryPtrUShort(gameProcess, targetAddress, value);
        }
Пример #2
0
        /// <summary>
        /// Save currently selected map layer to memory and map array.  Write related cache if writeCache = true.
        /// </summary>
        /// <param name="layer"></param>
        /// <param name="map"></param>
        /// <param name="writeCache"></param>
        public void commitFullMapLayer(int layer, Map map, bool writeCache)
        {
            MemoryApi.WriteMemoryPtrUShort(gameProcess, upperLeftMapArray[layer], map.mapInfoArray[layer]);

            if (writeCache)
            {
                if (layer == 0)
                {
                    MemoryApi.WriteMemoryPtrUShort(gameProcess, upperLeftMapCacheStyleArray[areaID], map.mapInfoArray[layer]);
                }
                else if (layer == 1)
                {
                    MemoryApi.WriteMemoryPtrUShort(gameProcess, upperLeftMapCacheColorArray[areaID], map.mapInfoArray[layer]);
                }
            }
        }
Пример #3
0
        public void commitSingleMap(UInt16 value, int layer, int index)
        {
            IntPtr targetAddress = IntPtr.Add(upperLeftMapArray[layer], index * 2);

            MemoryApi.WriteMemoryPtrUShort(gameProcess, targetAddress, value);
            if (layer == 0)
            {
                IntPtr targetCacheAddress = IntPtr.Add(upperLeftMapCacheStyleArray[areaID], index * 2);
                MemoryApi.WriteMemoryPtrUShort(gameProcess, targetCacheAddress, value);
            }
            else if (layer == 1)
            {
                IntPtr targetCacheAddress = IntPtr.Add(upperLeftMapCacheColorArray[areaID], index * 2);
                MemoryApi.WriteMemoryPtrUShort(gameProcess, targetCacheAddress, value);
            }
        }
Пример #4
0
 public void commitFullRoomLayer(int layer, Map map)
 {
     MemoryApi.WriteMemoryPtrUShort(gameProcess, upperLeftRoomArray[layer], map.roomLayerArray[layer]);
 }
Пример #5
0
        public void commitSingleRoom(UInt16 value, int layer, int index)
        {
            IntPtr targetAddress = IntPtr.Add(upperLeftRoomArray[layer], index * 2);

            MemoryApi.WriteMemoryPtrUShort(gameProcess, targetAddress, value);
        }