Coder Social home page Coder Social logo

d2d2s's People

Contributors

dependabot[bot] avatar gucio321 avatar restyled-commits avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

garfield-chen

d2d2s's Issues

Test template

Hi there, I'd like to describe used in a project tests template.
each _test.go file should look as follows:

  1. testdata() map[*TestedType]binaryFormat method.
    this method should specify as much, as possible/necessary test cases in described map form
  2. Test_Load(t *testing.T) this method is really easy
// declare testdata
td := testdata()

// testing loop
for key, value := range td {
    // load tested structure using data (value) given
    // in some cases, it could be necessary to create bitmuncher (datautils.CreateBitMuncher(value, 0) ) and pass it as an argument to load
    s := New()
    s.Load(value)

    // then just use `assert` to check results
    assert.Equal(t, key, s, "unexpected structure loaded")
}
  1. Test_Encode(t *testing.T) is also really simple
td := testdata()
for key, value := range td {
    // encode tested structure into binary form (value)
    data := key.Encode()

    // use assert to detect differences
    assert.Equal(t, value, data, "unexpected data encoded")
}

`d2sdifficulty`: add some api?

d2sdifficulty.Difficulty is a map-type. So I store pointer to it in main D2S structure, but the problem is, that reffering to a pointer-map is a bit... strange. it looks like `(*p.d2s.Difficulty)[d2enum.DifficultyNormal]. I suggest to add some api for this stuff or reduce this noise in some other way

possibility to create completely new data files which works with d2.

Currently, when we do:
ioutil.WriteFile("testchar.d2s", New().SetName("testchar").Encode(), 0o644)

full code here
package main

import (
	"io/ioutil"

	"github.com/gucio321/d2d2s/pkg/d2s"
)

func main() {
	data, _ := d2s.New().SetName("testchar").Encode()
	ioutil.WriteFile("testchar.d2s", data, 0o644)
}

we'll get
image

d2sstats: fix data size

For now, all data in Stats structure are uint64s or float64s
I think, that it could be something smaller

data reader/writer

OpenDiablo2/OpenDiablo2 dependency is a wrong idea. there are 2 alternatives:

  • use internal data reader (internal/datautils)
  • use OpenDiablo2/bitstream

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.