Example #1
0
 /**
  * Builds a direct object protobuf out of the information in this object
  */
 public DirectObjectProtocol getDirectObjectAsProtobuf()
 {
     DirectObjectProtocol.Builder builder = DirectObjectProtocol.CreateBuilder();
     builder.SetName(name);
     builder.SetType(type);
     return(builder.Build());
 }
Example #2
0
    /**
     * Builds a direct object protobuf out of the information in this object
     *
     * saves item information as well
     */
    public DirectObjectProtocol getDirectObjectAsProtobuf(Weapon item)
    {
        DirectObjectProtocol.Builder builder = DirectObjectProtocol.CreateBuilder();
        builder.SetName(name);
        builder.SetType(type);

        //yay scrambled crap-code!!!
        ItemProtocol.Builder iBuilder = ItemProtocol.CreateBuilder();
        iBuilder.SetVersion(0);
        iBuilder.SetLevelSpec(LevelSpecification.EXACT);
        iBuilder.SetSaveVersion(item.version);
        builder.SetItemInformation(iBuilder.Build());

        return(builder.Build());
    }