Add rover inventory capacity and test
This commit is contained in:
		
							parent
							
								
									e6ff453ff1
								
							
						
					
					
						commit
						2eaed1447d
					
				
					 7 changed files with 104 additions and 47 deletions
				
			
		|  | @ -72,6 +72,7 @@ func (s *Server) Rover(ctx context.Context, req *rove.RoverRequest) (*rove.Rover | ||||||
| 			}, | 			}, | ||||||
| 			Range:     int32(rover.Range), | 			Range:     int32(rover.Range), | ||||||
| 			Inventory: inv, | 			Inventory: inv, | ||||||
|  | 			Capacity:  int32(rover.Capacity), | ||||||
| 			Integrity: int32(rover.Integrity), | 			Integrity: int32(rover.Integrity), | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | @ -19,6 +19,9 @@ type Rover struct { | ||||||
| 	// Inventory represents any items the rover is carrying | 	// Inventory represents any items the rover is carrying | ||||||
| 	Inventory []objects.Object `json:"inventory"` | 	Inventory []objects.Object `json:"inventory"` | ||||||
| 
 | 
 | ||||||
|  | 	// Capacity is the maximum number of inventory items | ||||||
|  | 	Capacity int `json:"capacity"` | ||||||
|  | 
 | ||||||
| 	// Integrity represents current rover health | 	// Integrity represents current rover health | ||||||
| 	Integrity int `json:"integrity"` | 	Integrity int `json:"integrity"` | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -77,6 +77,7 @@ func (w *World) SpawnRover() (string, error) { | ||||||
| 	rover := Rover{ | 	rover := Rover{ | ||||||
| 		Range:     4.0, | 		Range:     4.0, | ||||||
| 		Integrity: 10, | 		Integrity: 10, | ||||||
|  | 		Capacity:  10, | ||||||
| 		Name:      uuid.New().String(), | 		Name:      uuid.New().String(), | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | @ -249,6 +250,11 @@ func (w *World) RoverStash(rover string) (objects.Type, error) { | ||||||
| 		return objects.None, fmt.Errorf("no rover matching id") | 		return objects.None, fmt.Errorf("no rover matching id") | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	// Can't pick up when full | ||||||
|  | 	if len(r.Inventory) >= r.Capacity { | ||||||
|  | 		return objects.None, nil | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	_, obj := w.Atlas.QueryPosition(r.Pos) | 	_, obj := w.Atlas.QueryPosition(r.Pos) | ||||||
| 	if !obj.IsStashable() { | 	if !obj.IsStashable() { | ||||||
| 		return objects.None, nil | 		return objects.None, nil | ||||||
|  |  | ||||||
|  | @ -129,18 +129,46 @@ func TestWorld_RoverStash(t *testing.T) { | ||||||
| 
 | 
 | ||||||
| 	// Set to a traversible tile | 	// Set to a traversible tile | ||||||
| 	world.Atlas.SetTile(pos, atlas.TileRock) | 	world.Atlas.SetTile(pos, atlas.TileRock) | ||||||
|  | 
 | ||||||
|  | 	rover, err := world.GetRover(a) | ||||||
|  | 	assert.NoError(t, err, "Failed to get rover") | ||||||
|  | 
 | ||||||
|  | 	for i := 0; i < rover.Capacity; i++ { | ||||||
|  | 		// Place an object | ||||||
|  | 		world.Atlas.SetObject(pos, objects.Object{Type: objects.SmallRock}) | ||||||
|  | 
 | ||||||
|  | 		// Pick it up | ||||||
|  | 		o, err := world.RoverStash(a) | ||||||
|  | 		assert.NoError(t, err, "Failed to stash") | ||||||
|  | 		assert.Equal(t, objects.SmallRock, o, "Failed to get correct object") | ||||||
|  | 
 | ||||||
|  | 		// Check it's gone | ||||||
|  | 		_, obj := world.Atlas.QueryPosition(pos) | ||||||
|  | 		assert.Equal(t, objects.None, obj.Type, "Stash failed to remove object from atlas") | ||||||
|  | 
 | ||||||
|  | 		// Check we have it | ||||||
|  | 		inv, err := world.RoverInventory(a) | ||||||
|  | 		assert.NoError(t, err, "Failed to get inventory") | ||||||
|  | 		assert.Equal(t, i+1, len(inv)) | ||||||
|  | 		assert.Equal(t, objects.Object{Type: objects.SmallRock}, inv[i]) | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	// Place an object | ||||||
| 	world.Atlas.SetObject(pos, objects.Object{Type: objects.SmallRock}) | 	world.Atlas.SetObject(pos, objects.Object{Type: objects.SmallRock}) | ||||||
| 
 | 
 | ||||||
|  | 	// Try to pick it up | ||||||
| 	o, err := world.RoverStash(a) | 	o, err := world.RoverStash(a) | ||||||
| 	assert.NoError(t, err, "Failed to stash") | 	assert.NoError(t, err, "Failed to stash") | ||||||
| 	assert.Equal(t, objects.SmallRock, o, "Failed to get correct object") | 	assert.Equal(t, objects.None, o, "Failed to get correct object") | ||||||
| 
 | 
 | ||||||
|  | 	// Check it's still there | ||||||
| 	_, obj := world.Atlas.QueryPosition(pos) | 	_, obj := world.Atlas.QueryPosition(pos) | ||||||
| 	assert.Equal(t, objects.None, obj.Type, "Stash failed to remove object from atlas") | 	assert.Equal(t, objects.SmallRock, obj.Type, "Stash failed to remove object from atlas") | ||||||
| 
 | 
 | ||||||
|  | 	// Check we don't have it | ||||||
| 	inv, err := world.RoverInventory(a) | 	inv, err := world.RoverInventory(a) | ||||||
| 	assert.NoError(t, err, "Failed to get inventory") | 	assert.NoError(t, err, "Failed to get inventory") | ||||||
| 	assert.Equal(t, objects.Object{Type: objects.SmallRock}, inv[0]) | 	assert.Equal(t, rover.Capacity, len(inv)) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func TestWorld_RoverDamage(t *testing.T) { | func TestWorld_RoverDamage(t *testing.T) { | ||||||
|  |  | ||||||
|  | @ -500,8 +500,10 @@ type RoverResponse struct { | ||||||
| 	Range int32 `protobuf:"varint,3,opt,name=range,proto3" json:"range,omitempty"` | 	Range int32 `protobuf:"varint,3,opt,name=range,proto3" json:"range,omitempty"` | ||||||
| 	// The items in the rover inventory | 	// The items in the rover inventory | ||||||
| 	Inventory []byte `protobuf:"bytes,4,opt,name=inventory,proto3" json:"inventory,omitempty"` | 	Inventory []byte `protobuf:"bytes,4,opt,name=inventory,proto3" json:"inventory,omitempty"` | ||||||
|  | 	// The capacity of the inventory | ||||||
|  | 	Capacity int32 `protobuf:"varint,5,opt,name=capacity,proto3" json:"capacity,omitempty"` | ||||||
| 	// The current health of the rover | 	// The current health of the rover | ||||||
| 	Integrity int32 `protobuf:"varint,5,opt,name=Integrity,proto3" json:"Integrity,omitempty"` | 	Integrity int32 `protobuf:"varint,6,opt,name=integrity,proto3" json:"integrity,omitempty"` | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (x *RoverResponse) Reset() { | func (x *RoverResponse) Reset() { | ||||||
|  | @ -564,6 +566,13 @@ func (x *RoverResponse) GetInventory() []byte { | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | func (x *RoverResponse) GetCapacity() int32 { | ||||||
|  | 	if x != nil { | ||||||
|  | 		return x.Capacity | ||||||
|  | 	} | ||||||
|  | 	return 0 | ||||||
|  | } | ||||||
|  | 
 | ||||||
| func (x *RoverResponse) GetIntegrity() int32 { | func (x *RoverResponse) GetIntegrity() int32 { | ||||||
| 	if x != nil { | 	if x != nil { | ||||||
| 		return x.Integrity | 		return x.Integrity | ||||||
|  | @ -773,7 +782,7 @@ var file_rove_rove_proto_rawDesc = []byte{ | ||||||
| 	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x28, 0x0a, 0x0c, 0x52, | 	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x28, 0x0a, 0x0c, 0x52, | ||||||
| 	0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, | 	0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, | ||||||
| 	0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, | 	0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, | ||||||
| 	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x9f, 0x01, 0x0a, 0x0d, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x52, | 	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xbb, 0x01, 0x0a, 0x0d, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x52, | ||||||
| 	0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, | 	0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, | ||||||
| 	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x08, 0x70, | 	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x08, 0x70, | ||||||
| 	0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, | 	0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, | ||||||
|  | @ -781,46 +790,48 @@ var file_rove_rove_proto_rawDesc = []byte{ | ||||||
| 	0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, | 	0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, | ||||||
| 	0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, | 	0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, | ||||||
| 	0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, | 	0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, | ||||||
| 	0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x49, 0x6e, 0x74, | 	0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x70, | ||||||
| 	0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x49, 0x6e, | 	0x61, 0x63, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x61, 0x70, | ||||||
| 	0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x22, 0x0f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, | 	0x61, 0x63, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, | ||||||
| 	0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x71, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, | 	0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, | ||||||
| 	0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x65, | 	0x69, 0x74, 0x79, 0x22, 0x0f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, | ||||||
| 	0x78, 0x74, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, | 	0x75, 0x65, 0x73, 0x74, 0x22, 0x71, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, | ||||||
| 	0x65, 0x78, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, | 	0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x74, | ||||||
| 	0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x12, 0x0a, | 	0x69, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x54, | ||||||
| 	0x04, 0x74, 0x69, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x69, 0x63, | 	0x69, 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, | ||||||
| 	0x6b, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, | 	0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x63, | ||||||
| 	0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x24, 0x0a, 0x06, 0x56, | 	0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x69, 0x63, 0x6b, 0x12, 0x18, 0x0a, | ||||||
| 	0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, | 	0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, | ||||||
| 	0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, | 	0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x24, 0x0a, 0x06, 0x56, 0x65, 0x63, 0x74, 0x6f, | ||||||
| 	0x79, 0x32, 0xf8, 0x02, 0x0a, 0x04, 0x52, 0x6f, 0x76, 0x65, 0x12, 0x44, 0x0a, 0x06, 0x53, 0x74, | 	0x72, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x78, 0x12, | ||||||
| 	0x61, 0x74, 0x75, 0x73, 0x12, 0x13, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, | 	0x0c, 0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x79, 0x32, 0xf8, 0x02, | ||||||
| 	0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72, 0x6f, 0x76, 0x65, | 	0x0a, 0x04, 0x52, 0x6f, 0x76, 0x65, 0x12, 0x44, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, | ||||||
| 	0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, | 	0x12, 0x13, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, | ||||||
| 	0x0f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x09, 0x12, 0x07, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, | 	0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x53, 0x74, 0x61, | ||||||
| 	0x12, 0x4f, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x72, | 	0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0f, 0x82, 0xd3, 0xe4, | ||||||
| 	0x6f, 0x76, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, | 	0x93, 0x02, 0x09, 0x12, 0x07, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x4f, 0x0a, 0x08, | ||||||
| 	0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, | 	0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, | ||||||
| 	0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, | 	0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, | ||||||
| 	0x93, 0x02, 0x0e, 0x22, 0x09, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x3a, 0x01, | 	0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, | ||||||
| 	0x2a, 0x12, 0x4f, 0x0a, 0x08, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x12, 0x15, 0x2e, | 	0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x22, | ||||||
| 	0x72, 0x6f, 0x76, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x71, | 	0x09, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x4f, 0x0a, | ||||||
| 	0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, | 	0x08, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x12, 0x15, 0x2e, 0x72, 0x6f, 0x76, 0x65, | ||||||
| 	0x61, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, | 	0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, | ||||||
| 	0xe4, 0x93, 0x02, 0x0e, 0x22, 0x09, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x3a, | 	0x1a, 0x16, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, | ||||||
| 	0x01, 0x2a, 0x12, 0x43, 0x0a, 0x05, 0x52, 0x61, 0x64, 0x61, 0x72, 0x12, 0x12, 0x2e, 0x72, 0x6f, | 	0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, | ||||||
| 	0x76, 0x65, 0x2e, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, | 	0x22, 0x09, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x43, | ||||||
| 	0x13, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, | 	0x0a, 0x05, 0x52, 0x61, 0x64, 0x61, 0x72, 0x12, 0x12, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, | ||||||
| 	0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x22, 0x06, 0x2f, 0x72, | 	0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72, 0x6f, | ||||||
| 	0x61, 0x64, 0x61, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x43, 0x0a, 0x05, 0x52, 0x6f, 0x76, 0x65, 0x72, | 	0x76, 0x65, 0x2e, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, | ||||||
| 	0x12, 0x12, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, | 	0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x22, 0x06, 0x2f, 0x72, 0x61, 0x64, 0x61, 0x72, | ||||||
| 	0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x6f, 0x76, 0x65, | 	0x3a, 0x01, 0x2a, 0x12, 0x43, 0x0a, 0x05, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x12, 0x2e, 0x72, | ||||||
| 	0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, | 	0x6f, 0x76, 0x65, 0x2e, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, | ||||||
| 	0x0b, 0x22, 0x06, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x42, 0x21, 0x5a, 0x1f, | 	0x1a, 0x13, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, | ||||||
| 	0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x64, 0x69, 0x6c, 0x75, | 	0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x22, 0x06, 0x2f, | ||||||
| 	0x7a, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x62, | 	0x72, 0x6f, 0x76, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x42, 0x21, 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x68, | ||||||
| 	0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, | 	0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x64, 0x69, 0x6c, 0x75, 0x7a, 0x2f, 0x72, 0x6f, | ||||||
|  | 	0x76, 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, | ||||||
|  | 	0x74, 0x6f, 0x33, | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| var ( | var ( | ||||||
|  |  | ||||||
|  | @ -312,7 +312,12 @@ | ||||||
|           "format": "byte", |           "format": "byte", | ||||||
|           "title": "The items in the rover inventory" |           "title": "The items in the rover inventory" | ||||||
|         }, |         }, | ||||||
|         "Integrity": { |         "capacity": { | ||||||
|  |           "type": "integer", | ||||||
|  |           "format": "int32", | ||||||
|  |           "title": "The capacity of the inventory" | ||||||
|  |         }, | ||||||
|  |         "integrity": { | ||||||
|           "type": "integer", |           "type": "integer", | ||||||
|           "format": "int32", |           "format": "int32", | ||||||
|           "title": "The current health of the rover" |           "title": "The current health of the rover" | ||||||
|  |  | ||||||
|  | @ -129,8 +129,11 @@ message RoverResponse { | ||||||
|     // The items in the rover inventory |     // The items in the rover inventory | ||||||
|     bytes inventory = 4; |     bytes inventory = 4; | ||||||
| 
 | 
 | ||||||
|  |     // The capacity of the inventory | ||||||
|  |     int32 capacity = 5; | ||||||
|  | 
 | ||||||
|     // The current health of the rover |     // The current health of the rover | ||||||
|     int32 Integrity = 5; |     int32 integrity = 6; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // Empty placeholder | // Empty placeholder | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue