public void removeItem(InventoryItem item) { this.items.Remove(item); }
public override void _Ready() { GD.Print("This is the same as overriding _Ready()... 2"); Account account = new Account { Email = "*****@*****.**", Active = true, CreatedDate = new DateTime(2013, 1, 20, 0, 0, 0, DateTimeKind.Utc), Roles = new List <string> { "User", "Admin" } }; string json = JsonConvert.SerializeObject(account, Formatting.Indented); // { // "Email": "*****@*****.**", // "Active": true, // "CreatedDate": "2013-01-20T00:00:00Z", // "Roles": [ // "User", // "Admin" // ] // } GD.Print(json); /*var foo = new Triangle3( * new SharpNav.Vector3(0, 0, 0), * new SharpNav.Vector3(0, 1f, 0), * new SharpNav.Vector3(0, 1f, 1f) * );*/ this.mainCamera = (PlayerCamera)GetNode("Navigation/PlayerCharacter/Camera"); this.playerCharacter = (KinematicBody)GetNode("Navigation/PlayerCharacter"); this.navigation = new App.Navigation(); this.immediateGeometry = (ImmediateGeometry)GetNode("ImmediateGeometry"); this.inventory = (Control)GetNode("Inventory"); this.characterScreen = (Control)GetNode("CharacterScreen"); var map = (Spatial)GetNode("Navigation/map"); if (map != null && this.navigation != null) { //this.generateNavigationMeshInstances(this.navigation, map.GetChildren()); if (this.playerCharacter != null) { var closestPoint = this.navigation.GetClosestPoint(this.playerCharacter.Translation); closestPoint.y = (float)Math.Round(closestPoint.y); closestPoint.y = 0; // this.playerCharacter.Translation = closestPoint; } } if (map != null) { var dummyItemOnTheGround = new App.Inventory.InventoryItem((Texture)GD.Load("res://static/dummy-sword-inventory-1x2.png"), new Vector2(1, 2)); var groundNode = dummyItemOnTheGround.getGroundNode(); groundNode.Translation = new Vector3(12f, -1f, -12f); map.AddChild(groundNode); } }
public bool hasItem(InventoryItem item) { return(this.items.Contains(item)); }