{"action":"created","issue":{"url":"https://api.github.com/repos/tomassedovic/tcod-rs/issues/172","labels_url":"https://api.github.com/repos/tomassedovic/tcod-rs/issues/172/labels{/name}","comments_url":"https://api.github.com/repos/tomassedovic/tcod-rs/issues/172/comments","events_url":"https://api.github.com/repos/tomassedovic/tcod-rs/issues/172/events","html_url":"https://github.com/tomassedovic/tcod-rs/issues/172","id":89100891,"number":172,"title":"Operators for wrapper types","user":{"login":"Gustorn","id":2189776,"avatar_url":"https://avatars.githubusercontent.com/u/2189776?v=3","gravatar_id":"","url":"https://api.github.com/users/Gustorn","html_url":"https://github.com/Gustorn","followers_url":"https://api.github.com/users/Gustorn/followers","following_url":"https://api.github.com/users/Gustorn/following{/other_user}","gists_url":"https://api.github.com/users/Gustorn/gists{/gist_id}","starred_url":"https://api.github.com/users/Gustorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gustorn/subscriptions","organizations_url":"https://api.github.com/users/Gustorn/orgs","repos_url":"https://api.github.com/users/Gustorn/repos","events_url":"https://api.github.com/users/Gustorn/events{/privacy}","received_events_url":"https://api.github.com/users/Gustorn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tomassedovic/tcod-rs/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/tomassedovic/tcod-rs/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-17T19:14:58Z","updated_at":"2015-06-18T20:48:26Z","closed_at":null,"body":"I started working on the heightmap wrapper and noticed that a large portion of the operations are basic arithmetic functions. In the current library `Color` has all its operations defined via member functions. We could move a lot of them out into `std::ops` implementations and free functions. Is this something we should do? If yes, should we still keep the explicit functions?\r\n"},"comment":{"url":"https://api.github.com/repos/tomassedovic/tcod-rs/issues/comments/113284600","html_url":"https://github.com/tomassedovic/tcod-rs/issues/172#issuecomment-113284600","issue_url":"https://api.github.com/repos/tomassedovic/tcod-rs/issues/172","id":113284600,"user":{"login":"tomassedovic","id":104339,"avatar_url":"https://avatars.githubusercontent.com/u/104339?v=3","gravatar_id":"","url":"https://api.github.com/users/tomassedovic","html_url":"https://github.com/tomassedovic","followers_url":"https://api.github.com/users/tomassedovic/followers","following_url":"https://api.github.com/users/tomassedovic/following{/other_user}","gists_url":"https://api.github.com/users/tomassedovic/gists{/gist_id}","starred_url":"https://api.github.com/users/tomassedovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomassedovic/subscriptions","organizations_url":"https://api.github.com/users/tomassedovic/orgs","repos_url":"https://api.github.com/users/tomassedovic/repos","events_url":"https://api.github.com/users/tomassedovic/events{/privacy}","received_events_url":"https://api.github.com/users/tomassedovic/received_events","type":"User","site_admin":false},"created_at":"2015-06-18T20:48:26Z","updated_at":"2015-06-18T20:48:26Z","body":"I'm fine implementing the ops traits where it makes sense. Does it for colours, though? I don't know enough about colour theory (or the practice in computer graphics) to know if these are the standard operations of if they're libtcod-specific (I know about `lerp` but that doesn't have a suitable operator anyway).\r\n\r\nNot sure about converting methods to free functions, though. I'm not opposed to it per se, but the methods seem a bit more convenient to me.\r\n\r\nBut yeah, if we do implement some of the ops traits, I think we can remove the corresponding methods."}}