Commit b9478d74 authored by Ashley's avatar Ashley
Browse files

fixed merge requests? Maybe?

parent 2ba49325
fileFormatVersion: 2
guid: 74d7f1f922d265a4cb8e8989f9608bbf
timeCreated: 1477086866
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 1
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: 0
aniso: 16
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 5
buildTargetSettings: []
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
Assets/Resources/Prefab/1_front.prefab
0
0
0
Assets/Resources/Prefab/5_back.prefab
255
255
255
Assets/Resources/Prefab/crate_16.prefab
255
0
0
Assets/Resources/Prefab/Tree_01.prefab
0
255
0
fileFormatVersion: 2
guid: 9f2b9f8232e8aef43b9a2de4500b7fff
folderAsset: yes
timeCreated: 1477613634
guid: b994f2c1c032bdf47a3135af993751bf
timeCreated: 1477086128
licenseType: Free
DefaultImporter:
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 6447dc2c5563810409fde3b2d66630cc
timeCreated: 1477613639
guid: 87ed77aef35072942a2705888df1a98f
timeCreated: 1477086529
licenseType: Free
NativeFormatImporter:
userData:
......
fileFormatVersion: 2
guid: 610ddd4392217474b923bb8ef67b3344
timeCreated: 1477613638
guid: fe45769cb9d72ef458a5450c4d6cb5f6
timeCreated: 1477086550
licenseType: Free
NativeFormatImporter:
userData:
......
fileFormatVersion: 2
guid: 47cd14cbf89bb8c4e9312e93e76b8811
timeCreated: 1477086506
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: a7980e3cc7ad39d4aa968cb9fe241a0a
folderAsset: yes
timeCreated: 1477613634
guid: 9ebfaa068bf3ce248a1b8b8036d59c46
timeCreated: 1477086128
licenseType: Free
DefaultImporter:
userData:
......
fileFormatVersion: 2
guid: 647a00acb440c0c4aa002d9f0ae2ffd5
folderAsset: yes
timeCreated: 1475761198
guid: d9bbbcc5e70ac6c4bbd42b3651aefea7
timeCreated: 1477611955
licenseType: Free
DefaultImporter:
userData:
......
fileFormatVersion: 2
guid: b81863a609d40aa4ca9995a23dc2e59d
folderAsset: yes
timeCreated: 1477613634
guid: 2c983046a45213c438316fd281ecc003
timeCreated: 1477182966
licenseType: Free
DefaultImporter:
userData:
......
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
/*
public class Heap <Tile> where Tile : HeapItem<Tile>{
Tile[] heapTiles;
int itemCount;
//replace openList with Heap
//add heapIndex, compareTo to tile class
//compare fCost of node then hCost
//item.compareTo(item2) should return pos if item is less than item2, neg if item is greater than item2
//create heap
public Heap(int maxSize)
{
heapTiles = new Tile[maxSize];
}
//add item into heap and sort it into position
public void Add(Tile item)
{
item.heapIndex = itemCount;
heapTiles[itemCount] = item;
SortUp(item);
itemCount++;
}
//remove first tile and resort heap
public Tile RemoveFirst()
{
Tile first = heapTiles[0];
itemCount--;
heapTiles[0] = heapTiles[itemCount];
heapTiles[0].heapIndex = 0;
SortDown(heapTiles[0]);
return first;
}
//resort item position
public void UpdateItem(Tile item)
{
SortUp(item);
}
public int Count
{
get
{
return itemCount;
}
}
//does heap contain item
public bool Contains(Tile item)
{
return Equals(heapTiles[item.heapIndex], item);
}
//sort tile lower into heap
void SortDown(Tile item)
{
while (true)
{
int leftChildIndex = item.heapIndex * 2 + 1;
int rightChildIndex = (item.heapIndex * 2) + 2;
int swapIndex = 0;
if (leftChildIndex < itemCount)
{
swapIndex = leftChildIndex;
if (rightChildIndex < itemCount)
{
if (heapTiles[leftChildIndex].CompareTo(heapTiles[rightChildIndex]) < 0)
{
swapIndex = rightChildIndex;
}
}
if (item.CompareTo(heapTiles[swapIndex]) < 0)
{
Swap(item, heapTiles[swapIndex]);
}
else
{
return;
}
}
else
{
return;
}
}
}
//sort item higher into heap
void SortUp(Tile item)
{
int indexOfParent = (item.heapIndex - 1) / 2;
while (true)
{
Tile parent = heapTiles[indexOfParent];
if (item.CompareTo(parent) > 0)
{
Swap(item, parent);
}
else
{
break;
}
indexOfParent = (item.heapIndex - 1) / 2;
}
}
//swap tiles
void Swap(Tile item1, Tile item2)
{
heapTiles[item1.heapIndex] = item2;
heapTiles[item2.heapIndex] = item1;
int tempIndex = item1.heapIndex;
item1.heapIndex = item2.heapIndex;
item2.heapIndex = tempIndex;
}
}
public interface HeapItem<Tile> : IComparable<Tile>
{
int heapIndex
{
get;
set;
}
}
*/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment