-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Differentiate between walls made from bars, blocks, and wood.
- Loading branch information
Japa
committed
Jun 21, 2015
1 parent
3396d64
commit 124b6ef
Showing
6 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,35 @@ | ||
using System.Xml.Linq; | ||
|
||
public class ItemContent<T> : ContentConfiguration<T> where T : IContent, new() | ||
public class ItemConfiguration<T> : ContentConfiguration<T> where T : IContent, new() | ||
{ | ||
ItemMatcher<Content> itemMatcher = new ItemMatcher<Content>(); | ||
|
||
public override bool GetValue(MapDataStore.Tile tile, MeshLayer layer, out T value) | ||
{ | ||
throw new System.NotImplementedException(); | ||
Content cont; | ||
if (itemMatcher.Get(tile.construction_item, out cont)) | ||
{ | ||
value = cont.GetValue(tile, layer); | ||
return true; | ||
} | ||
value = default(T); | ||
return false; | ||
} | ||
|
||
protected override void ParseElementConditions(XElement elemtype, ContentConfiguration<T>.Content content) | ||
{ | ||
throw new System.NotImplementedException(); | ||
var elemItems = elemtype.Elements("item"); | ||
foreach (XElement elemItem in elemItems) | ||
{ | ||
XAttribute elemToken = elemItem.Attribute("token"); | ||
if (elemToken != null) | ||
{ | ||
if (elemToken.Value == "NONE") | ||
defaultItem = content; | ||
else | ||
itemMatcher[elemToken.Value] = content; | ||
continue; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters